Muratatak
Feb 3, 2023

class DaddyClass

@@number = 1

end

class SonClass < DaddyClass

@@number = 2

end

class ParentClass

puts @@number

end

class_var.rb:10:in `<class:ParentClass>': uninitialized class variable @@number in ParentClass (NameError)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Muratatak
Muratatak

Written by Muratatak

Software Engineer, Rubyist, Follow Rails Way

Responses (1)

Write a response