るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.117秒)
トップページ > クエリ:i[x] > クエリ:singleton_method[x] > クラス:Module[x]

別のキーワード

  1. singleton clone
  2. singleton dup
  3. singleton instance
  4. object define_singleton_method
  5. _builtin define_singleton_method

ライブラリ

検索結果

Module#method_undefined(name) -> () (6107.0)

このモジュールのインスタンスメソッド name が Module#undef_method によって削除されるか、 undef 文により未定義にされると、インタプリタがこのメソッドを呼び出します。

...スメソッド name が
Module
#undef_method によって削除されるか、
undef 文により未定義にされると、インタプリタがこのメソッドを呼び出します。

特異メソッドの削除をフックするには
BasicObject#singleton_method_undefined
を使います。...
...ド名が Symbol で渡されます。

//emlist[例][ruby]{
class C
def C.method_undefined(name)
puts "method C\##{name} was undefined"
end

def foo
end
def bar
end

undef_method :foo
undef bar
end
//}

実行結果:

method C#foo was undefined
method C#bar was undefined...