Skip to content

Instantly share code, notes, and snippets.

@kachick
Last active December 30, 2015 21:39
Show Gist options
  • Save kachick/7888694 to your computer and use it in GitHub Desktop.
Save kachick/7888694 to your computer and use it in GitHub Desktop.
undef_methodの動作がいっつもピンと来ないので確認
# 「上位含めて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