24件ヒット
[1-24件を表示]
(0.348秒)
ライブラリ
- ビルトイン (24)
クラス
- BasicObject (12)
- Module (12)
検索結果
-
BasicObject
# singleton _ method _ undefined(name) -> object (24208.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
...るフックには
Module#method_undefined を使います。
@param name 未定義にされたメソッド名が Symbol で渡されます。
//emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end
end
obj = Foo.new
def ob......foo
end
def obj.bar
end
class << obj
undef_method :foo
end
obj.instance_eval {undef bar}
#=> singleton method "foo" was undefined
# singleton method "bar" was undefined
//}
@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef... -
Module
# method _ undefined(name) -> () (6107.0) -
このモジュールのインスタンスメソッド name が Module#undef_method によって削除されるか、 undef 文により未定義にされると、インタプリタがこのメソッドを呼び出します。
...ックするには
BasicObject#singleton_method_undefined
を使います。
@param name 削除/未定義にされたメソッド名が Symbol で渡されます。
//emlist[例][ruby]{
class C
def C.method_undefined(name)
puts "method C\##{name} was undefined"
end
def foo
end
def b......ar
end
undef_method :foo
undef bar
end
//}
実行結果:
method C#foo was undefined
method C#bar was undefined...