Created
March 19, 2009 02:08
-
-
Save dchelimsky/81543 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
class Example | |
def foo; puts "foo"; end | |
def bar; puts "bar"; end | |
def foo_with_bar | |
foo_without_bar | |
bar | |
end | |
end | |
e = Example.new | |
e.foo | |
e.bar | |
e.foo_with_bar | |
e.foo_without_bar | |
class Example | |
alias_method :foo_without_bar, :foo | |
alias_method :foo, :foo_with_bar | |
end | |
e.foo | |
e.bar | |
e.foo_with_bar | |
e.foo_without_bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment