Getting a class' subclasses
I needed a way to get a list of the subclasses that inherit a specific.
Unfortunately there is no method like Class.subclasses
(there is Class.superclass
, though) so I had to look for
another way to achieve this. Let’s say, we want to have an array
containing all subclasses as a class variable of our superclass
Strategy
. In order to fill the array we’ll overwrite the
inherited
class method of Class
.