From: nobu.nokada@... Date: 2002-08-27T13:31:55+09:00 Subject: Re: Getting list of classes in a module? Hi, At Tue, 27 Aug 2002 12:54:56 +0900, Philip Mak wrote: > > Try this: > > > > def classes_under( mod ) > > mod.constants.map {|name| mod.const_get(name) }.select {|v| Class === v } > > end > > classes_under(YourFavoriteModule) > > Thanks! I ended up doing this, which is essentially the same but a bit > simpler: > > def classes_under(mod) > mod.constants.select{|v| mod.const_get(v).type == Class} > end Did you want the list of class names, not of classes themselves? -- Nobu Nakada