Created
November 7, 2019 07:34
-
-
Save igaiga/61051176c280313bc92c827dcc9b5dd5 to your computer and use it in GitHub Desktop.
This file contains 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 foo | |
"A" | |
end | |
end | |
class B < A | |
def foo | |
"B" + super | |
end | |
end | |
class C < B | |
def foo | |
"C" + super | |
end | |
end | |
B.class_eval{ remove_method :foo } | |
p C.new.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment