Skip to content

Instantly share code, notes, and snippets.

@pat
Forked from benschwarz/super.rb
Created April 25, 2009 05:54
Show Gist options
  • Save pat/101519 to your computer and use it in GitHub Desktop.
Save pat/101519 to your computer and use it in GitHub Desktop.
class A
def initialize
dispatch if respond_to?(:dispatch)
end
end
class B < A
def dispatch
puts "called dispatch"
end
end
B.new #=> "called dispatch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment