Created
February 24, 2009 00:57
-
-
Save julien51/69306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> class Cool; def moo; 5; end; def do; moo; end end | |
=> nil | |
irb(main):002:0> module Zoop; def moo; 4; end end | |
=> nil | |
irb(main):003:0> class Za < Cool; alias_method :rawr, :moo; include Zoop; end | |
=> Za | |
irb(main):004:0> Za.new.moo | |
=> 4 # Ok | |
irb(main):005:0> Za.new.rawr | |
=> 5 # Ok | |
irb(main):006:0> Za.new.do | |
=> 4 # Ko! | |
irb(main):007:0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment