class MyClass def MyClass.inherited(subclass) puts "#{subclass} inherits from MyClass." endendclass OtherClass < MyClassend# Output: OtherClass inherits from MyClass.