Suppose I have the following:
module A
class B
end
end
And suppose I have several different files, like this one, with different B values, but all in one module (A). From the program in which requirethere is a file, which then requireeach of these files has, is there an introspection / reflection method (are these different things? Am I distinguished if this is so) to determine (and get objects for) each class in the module?
I tried this, which closed me:
A.constants # => ["B"]
But I would prefer to return [A::B], rather than a string, so that I can call something like singleton_methodson it, which would be useful for my program, which is trying to map data into calls to methods of various subclasses.
? , this , .