From: Kent Dahl Date: 2002-12-06T16:58:47+09:00 Subject: Re: Printing subclasses ted wrote: > > Can Ruby print the subclasses of a given class? Like the reverse of the > example of Class#superclass in "Reflection, ObjectSace and Distributed > Ruby" in pickaxe. A heavy handed way is using ObjectSpace: a = StandardError # just as an example ObjectSpace.each_object(Class){|i| puts i if i.superclass==a} Probably exists a neater way that has eluded me so far. -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 5. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)