From: zig Date: 2007-03-25T10:40:10+09:00 Subject: Re: class methods and instance variables in ActiveRecord::Base On Mar 24, 3:56 pm, "Giles Bowkett" wrote: > The answer to your question is that the class which inherits is opened > up, and this method is defined within it. Not the instances -- the > instances are untouched. This opens up the Class object itself. Then, > obviously, it sets an instance variable. At that point, what it's > doing is setting an instance variable of the Class object. > OK, I think I'm getting there. Is an instance variable of the class object the same thing as a class variable? For example, consider class A @@var1 end and class A class << self attr_reader :var1 attr_writer :var1 end end In both cases I call that variable with A.var1. Are they the same?