If you want to get all subclasses of SomeClass, follow these steps:
SomeClass.descendants
Similarly, if you want to learn the parent classes, use:
SomeClass.ancestors
This will give you an array for your consumption. So you can:
SomeClass.descendants.each { |klass| }
source
share