According to wikibooks...
@one
below is an instance variable belonging to the class object (note this is not the same as a class variable and could not be referred to as@@one
)@@value
is a class variable (similar to static in Java or C++).@two
is an instance variable belonging to instances of MyClass.
My questions:
What's the difference between @one and @@value?
Also, is there a reason to use @one at all?
class MyClass
@one = 1
@@value = 1
def initialize()
@two = 2
end
end