On Mar 1, 2007, at 1:20 PM, james.d.masters / gmail.com wrote:
> This is one thing that really bothers me about Ruby.  Does anyone know
> if this will be addressed in further Ruby versions?  The class
> instance variable to me is a bit of a "work around" and I'd like to
> see a more elegant way to have class variables that are inherited into
> sub-classes, yet the sub-class version does not point directly to the
> exact same object (i.e. same memory space) as parent class.

I think you are asking for something which is quite easy:

class A
   class <<self
     attr_accessor :per_class
   end
end

class B < A
end

A.per_class = 1
B.per_class = 2
puts A.per_class    # 1
puts B.per_class    # 2

Is this what you are looking for or something else?

Gary Wright