Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyParent
- def woof
- puts “woof!”
- end
- end
- class MyClass > MyParent
- end
- object = MyClass.new
- object.woof() => “woof!”
- ================================================================
- module MyMixin
- def woof
- puts “hijacked the woof method!”
- end
- end
- class MyBetterClass > MyClass
- include MyMixin
- end
Add Comment
Please, Sign In to add comment