From: August Lilleaas Date: 2010-02-02T06:05:06+09:00 Subject: Re: Module children On Feb 1, 8:50 pm, Camille Roux wrote: > Hello, > > I'd like to get the list of all the classes contained in a module. > What's the simple way to do that? > > Thank you > -- > Posted viahttp://www.ruby-forum.com/. Here's a quick and dirty implementation using ObjectSpace module LibraryWrapperThing class UtilityClassA; end class Fish; end class Dog; end end class NotMe; end classes = [] ObjectSpace.each_object do |obj| classes << obj if Module === obj end p classes.select {|c| c.name =~ /^LibraryWrapperThing::/ } # => [LibraryWrapperThing::Dog, LibraryWrapperThing::Fish, ...]