Материал из Wiki.crossplatform.ru
(Различия между версиями)
Версия 17:10, 26 мая 2010
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.