I have a module MyModule. I dynamically load classes into it. How can I get a list of the classes defined within its namespace?
MyModule
Example:
Classes are accessed through constants. Classes defined within a module are listed as constants in that module. So you just need to choose the constants that refer to classes.
MyModule.constants.select {|c| MyModule.const_get(c).is_a? Class}