Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created March 19, 2009 02:08
Show Gist options
  • Save dchelimsky/81543 to your computer and use it in GitHub Desktop.
Save dchelimsky/81543 to your computer and use it in GitHub Desktop.
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