The syntax @myvaridentifies myvaras an instance variable, so the real question is this:
What is selfinside a class method?
And the answer " selfis a class object." Thus, @myvaris an instance variable of a class object Foo. If you add another class method:
class Foo
def self.pancakes_house
@myvar
end
end
And then do the following:
Foo.bar
puts Foo.pancakes_house
You will see xthe standard output.