Created
June 18, 2010 17:41
-
-
Save gnufied/443953 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
module Foo | |
def hello | |
puts "Hello from Foo" | |
end | |
end | |
module Bar | |
def self.included(base_klass) | |
base_klass.class_eval do | |
alias_method :old_hello, :hello | |
end | |
end | |
end | |
class Baz | |
include Foo | |
include Bar | |
end | |
a = Baz.new() | |
a.old_hello() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment