2007/10/18, Brian Adkins <lojicdotcom / gmail.com>: > On Oct 17, 4:10 pm, Perry Smith <p... / easesoftware.com> 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? Probably because class variables have @@various issues as has discusses before. I would also recommend to not use them. Kind regards robert