Skip to content

Instantly share code, notes, and snippets.

@purp
Created March 29, 2011 22:33
Show Gist options
  • Save purp/893496 to your computer and use it in GitHub Desktop.
Save purp/893496 to your computer and use it in GitHub Desktop.
How to alias method chain manually
def foo
'foo'
end
def foo_with_bar
foo_without_bar + 'bar'
end
alias foo_without_bar foo
alias foo foo_with_bar
foo_without_bar
# => foo
foo_with_bar
# => foobar
foo
# => foobar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment