Clean and easy to understand.
It's good solution for the kata, but imagine a real-life app with hundreds of classes :)
Kata's description states:
Write a class called "Mother" that tracks all inheritances that are done to her (and her kids)
Does that mean that Mother should call her grandchildren too? If so, there should be a test for that (and half of current solutions wouldn't pass it :)).
It seems like your solution wont work for grandchildren:
class Foo < Mother; end class Bar < Mother; end class Baz < Bar; end Mother.phone_kids # => calls only Foo, Bar.
Loading collection data...
Clean and easy to understand.
It's good solution for the kata, but imagine a real-life app with hundreds of classes :)
Kata's description states:
Does that mean that Mother should call her grandchildren too? If so, there should be a test for that (and half of current solutions wouldn't pass it :)).
It seems like your solution wont work for grandchildren: