Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. class MyParent
  2.      def woof
  3.           puts “woof!”
  4.      end
  5. end
  6.  
  7. class MyClass > MyParent
  8. end
  9.  
  10. object = MyClass.new
  11. object.woof() => “woof!”
  12.  
  13. ================================================================
  14.  
  15. module MyMixin
  16.      def woof
  17.           puts “hijacked the woof method!”
  18.      end
  19. end
  20.  
  21. class MyBetterClass > MyClass
  22.      include MyMixin
  23. end