Last active
August 29, 2015 14:22
-
-
Save ore-public/8d75517d56e684fc0e2a to your computer and use it in GitHub Desktop.
method_missingの挙動
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 Hoge | |
def mmtest | |
hoge #method_missing が呼ばれる => :hoge | |
hoge = 10 #mmtestメソッド内のローカル変数が定義される | |
self.hoge=10 #method_missing が呼ばれる => :hoge= | |
end | |
def method_missing(method_name, *args) | |
p method_name | |
end | |
end | |
h = Hoge.new | |
h.mmtest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment