Hello.
class Test
@a = "value"
def self.a
@a
end
def initialize
@@a = "value2"
end
def a
@@a
end
end
puts Test.a # output: value
puts Test.new.a # output: value2
I don't understand (and I'm quite surprised), what is the difference in terms of
OO design between class variables, the @@a in the example above, and class
instance variables, the @a in the example?
Thanks in advance,
Lionel Thiry