From: Brian Adkins Date: 2007-10-18T14:15:08+09:00 Subject: Re: Class instance variable idiom On Oct 17, 4:10 pm, Perry Smith wrote: > I am using this technique for class instance variables: > > class << self > def set_foo(s) > @foo = s > end > alias :foo= :set_foo > > def foo > @foo > end > end > > Then to reference foo from an instance of the class (or subclass), I do: > > self.class.foo > > Is there a cleaner way, in particular for the reference of the class > instance variable, to do this? Just out of curiosity, why do you want a "class instance variable" instead of a class variable?