From: Michael Neumann Date: 2001-04-07T02:03:02+09:00 Subject: [ruby-talk:13537] Re: List of all instances of a class Romuald Texier wrote: > Is there a way to get a list of all instances of a class (and its > subclasses) without iterating over all objects ? You could implement the behavior in Ruby: class InstClass @@instances = [] def initialize @@instances << self end def InstClass.getInstances @@instances end end Of course this has a little problem, because GC will not free any instance of that class. Regards Michael