Skip to content

Instantly share code, notes, and snippets.

@jqr
Created April 25, 2009 04:21
Show Gist options
  • Save jqr/101489 to your computer and use it in GitHub Desktop.
Save jqr/101489 to your computer and use it in GitHub Desktop.
class A
def initialize
puts "A initialized"
end
end
class B < A
alias :original_initialize :initialize
def initialize
puts "B initialized"
end
end
b = B.new
b.send(:original_initialize)
# >> B initialized
# >> A initialized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment