I’m a noob myself so sorry if I give incorrect information but I think
you have a going out of scope issue. The inheirtors method is defined
within the class that starts on line 3. However, the class it’s put in
is inside the extended method on line 2, so what I think is going on is
that by the time you’re trying to the inheirtors method, its class has
already gone out of scope since it’s called after the extended method
has ended.
-:28: undefined method `inheritors’ for Parent:Class
(NoMethodError)
When you open the singleton class of parent, you don’t need to define
the methods for “self.”, just define them directly, cause you are
already on the singleton class: