Skip to content

Instantly share code, notes, and snippets.

@julien51
Created February 24, 2009 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julien51/69306 to your computer and use it in GitHub Desktop.
Save julien51/69306 to your computer and use it in GitHub Desktop.
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