Last active
December 30, 2015 21:39
-
-
Save kachick/7888694 to your computer and use it in GitHub Desktop.
undef_methodの動作がいっつもピンと来ないので確認
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
# 「上位含めてundef扱いにする」の上位っていうのは、undefした瞬間じゃなくて動的に判断される? | |
module Super1 | |
def a; end | |
end | |
module Super2 | |
def a; end | |
undef_method :a | |
end | |
class Base | |
include Super1 | |
include Super2 | |
end | |
Base.new.a #=> undefined method `a' for #<Base:0x007fb47e570a50> (NoMethodError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment