From: Tom Sawyer Date: 2002-08-27T13:26:20+09:00 Subject: Re: Getting list of classes in a module? by the way (only slightly off topic) is there a difference between the methods Object#type and Object#class ? On Mon, 2002-08-26 at 21:54, 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 > -- ~transami