From: Malte Milatz Date: 2004-06-27T23:33:02+09:00 Subject: Re: accessing a subclass Florian Weber wrote: > class Apple < Fruit > add_something "foobar" > end > > in the fruit class i have a add_something method which i want to save > the "foobar" to a static hash in the apple class. the hash however > should also not be declared in the apple class. I'm not sure if I understood you correctly, but what about adding class Apple attr_accessor :the_hash end class Fruit def add_something(obj) # Using the_hash here # Alternatively, use instance_variable_get(:"@the_hash") # I haven't tested both, however end end I don't think, however, that such a procedure would be desirable. -- My email address is malte at gmx-topmail.de