Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created May 26, 2012 18:03
Show Gist options
  • Select an option

  • Save practicingruby/2794795 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/2794795 to your computer and use it in GitHub Desktop.
class A
def a
b
end
def b
puts "YAY"
end
end
class B < A
def b
puts "Overridden"
end
end
require "delegate"
class C
def b
puts "Never called"
end
def method_missing(*a, &b)
A.new.public_send(*a, &b)
end
end
B.new.a
C.new.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment