class Test
class << self
attr_accessor :some
def set_some
puts self.inspect
some = \'some_data\'
end
def get_some
puts sel
In the first example some is a local variable.
In the second one, some is a method of self. Why? Because attr_accessor :some is the same as:
def some= (val)
@some = val
end
def some
return @some
end
So, you have created the getter and setter methods for the instance variable @some (it's an instance variable of the object Test, as every class is also an object of class Class).