From: Ryan Davis Date: 2009-03-02T20:11:23+09:00 Subject: Re: Delegating class methods On Mar 2, 2009, at 03:05 , abc wrote: > I'm not a seasoned Ruby programmer, but I think I was totally right in > the idea of using class variables (@@hash). No, using a class var there was totally appropriate. In the case of your design, depending on what you're actually trying to accomplish by registering every instance, you can forgo the registration hash and use: ObjectSpace.each_object(YourClass) { |obj| ... } That only iterates live objects and also has the disadvantage of not working in jruby or rubinius (yet?).