Skip to content

Instantly share code, notes, and snippets.

@fd
Created May 12, 2011 14:42
Show Gist options
  • Select an option

  • Save fd/968635 to your computer and use it in GitHub Desktop.

Select an option

Save fd/968635 to your computer and use it in GitHub Desktop.
call a superclass method without `super`
class A
def foo
puts "bar #{self.class}"
end
end
class B < A
def foo
puts "baz #{self.class}"
end
end
m = A.instance_method(:foo)
m = m.bind(B.new)
m.call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment