Skip to content

Instantly share code, notes, and snippets.

@marick
Created October 22, 2011 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marick/1306206 to your computer and use it in GitHub Desktop.
Save marick/1306206 to your computer and use it in GitHub Desktop.
# Original definition
class Whatever
def initialize
end
end
# Redefinition
class Whatever
alias_method :old_initialize, :initialize
def initialize(*args)
puts "Initializing #{self.class}"
old_initialize(*args)
end
end
Whatever.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment