Created
April 27, 2009 18:11
-
-
Save jasonroelofs/102626 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
def method_missing(*args) | |
puts "Missing in A" | |
end | |
end | |
class B < A | |
def method_missing(*args) | |
puts "Missing in B" | |
end | |
end | |
class C < B | |
def method_missing(*args) | |
puts "Missing in C" | |
super | |
end | |
end | |
a = A.new | |
b = B.new | |
c = C.new | |
a.no_method | |
#=> Missing in A | |
b.no_method | |
#=> Missing in B | |
c.no_method | |
#=> Missing in C | |
#=> Missing in B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment