Listen to inheritance action
class MyClass def MyClass.inherited(subclass) puts "#{subclass} inherits from MyClass." end end class OtherClass < MyClass end # Output: OtherClass inherits from MyClass.