Skip to content

Instantly share code, notes, and snippets.

@isaacsanders
Forked from marick/gist:1306206
Created October 22, 2011 17:11
Show Gist options
  • Save isaacsanders/1306234 to your computer and use it in GitHub Desktop.
Save isaacsanders/1306234 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, &block)
puts "Initializing #{self.class}"
old_initialize(*args, &block)
end
end
Whatever.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment