Is there a way to get the list of all defined classes. I'm looking for a code like this:
Class.instances.each do |klass|
puts klass.name
end
If there is no way to do this. It is possible to define a class A such that its descendants are registered in it? For example in this way:
class A
...
end
class B < A
end
class C < B
end
A.descendants # => [B, C]