From: Peter Szinek Date: 2008-11-19T18:49:05+09:00 Subject: Re: Is there a way to know what are the subclasses of a given class ? --Apple-Mail-16--326935921 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit In your above example, B is not subclass of A (B is not even defined, just A::B). Also, how about class A class B end class C end D = E = F = 5 end >> A.constants => ["C", "B", "D", "F", "E"] What are you trying to do exactly? Maybe modules would be better? Cheers, Peter ___ http://www.rubyrailways.com http://scrubyt.org On 2008.11.19., at 10:10, Sandro Paganotti wrote: > [SOLVED] > > I just find out that you can call: > > A.constants --> ["B","C"] > > Thank you > > Sandro > > On Wed, Nov 19, 2008 at 10:10 AM, Sandro Paganotti < > sandro.paganotti@gmail.com> wrote: > >> Hello >> >> Do you know if there's a trick to retrieve a list of all the >> subclasses of >> a given class ? >> >> class A >> class B >> end >> class C >> end >> end >> >> like A.subclasses --> [B,C] ? >> >> Thanks >> Sandro >> >> -- >> sandropaganotti.com >> > > > > -- > Go outside! The graphics are amazing! --Apple-Mail-16--326935921--