From: Eugene Scripnik Date: 2003-01-04T01:58:49+09:00 Subject: Re: toplevel modules and classes Friday, January 3, 2003, 5:49:04 PM, you wrote: YM> In message "toplevel modules and classes" YM> on 03/01/04, Eugene Scripnik writes: YM> | YM> | How do I get all defined toplevel modules and classes? YM> ruby -e 'Object.constants.each{|c| c = Object.const_get(c); p c if c.kind_of?(Module)}' OK, another question. Module#constants return constants accessible in this module. But Class#constants produces the same output as Object.constants (Class itself is an Object, right?). How do I get all modules and classes defined in this particular class? -- Best regards, Eugene [team Enticla] mailto:Eugene.Scripnik@itgrp.net