Skip to content

Instantly share code, notes, and snippets.

@capitalist
Created November 4, 2008 22:44
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 capitalist/22239 to your computer and use it in GitHub Desktop.
Save capitalist/22239 to your computer and use it in GitHub Desktop.
# This Gist is here to explain the wonders of alias_method_chain
#
# It's also pulling double duty as an example of the gist method in training wheels.
#
# Some stuff about alias_method_chain... blah, blah blah
# Example: Ripped off from errtheblog
def render_with_benchmark(*args)
benchmark("Render call") do
render_without_benchmark(*args)
end
end
alias_method_chain :render, :benchmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment