From: ts Date: 2001-03-14T02:59:46+09:00 Subject: [ruby-talk:12576] Re: class variables >>>>> "C" == Christoph Rippel writes: C> The question is how get a handle on the meta class this is what C> MetaFred = ObjectSpace._id2ref ( C> class << Fred C> id C> end ) C> does. Now I can define MetaFred method which has access to this variable C> def MetaFred.var C> @var C> end C> that is C> p MetaFred.var # => 234 I'm probably stupid but why you don't write ? class Fred @var = 234 end def Fred.var @var end p Fred.var variable with the prefix '@@' was introduced because it's was not possible to access a class variable in a method, i.e. class Fred def toto @var # this is always an instance variable end end Guy Decoux