るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.342秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:end[x] > クエリ:singleton_method_removed[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

検索結果

BasicObject#singleton_method_removed(name) -> object (18132.0)

特異メソッドが Module#remove_method に より削除された時にインタプリタから呼び出されます。

...Symbol で渡されます。

//emlist[例][ruby]{
class Foo
def singleton_method_removed(name)
puts "singleton method \"#{name}\" was removed"
end

end


obj = Foo.new
def obj.foo
end


class << obj
remove_method :foo
end


#=> singleton method "foo" was removed
//}

@see Module#method_remov...

BasicObject#singleton_method_undefined(name) -> object (37.0)

特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。

...class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end

end


obj = Foo.new
def obj.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" wa...

BasicObject#singleton_method_added(name) -> object (25.0)

特異メソッドが追加された時にインタプリタから呼び出されます。

...emlist[例][ruby]{
class Foo
def singleton_method_added(name)
puts "singleton method \"#{name}\" was added"
end

end


obj = Foo.new
def obj.foo
end


#=> singleton method "foo" was added
//}

@see Module#method_added,BasicObject#singleton_method_removed,BasicObject#singleton_method_undefined...

Module#method_removed(name) -> () (25.0)

メソッドが Module#remove_method により削除 された時にインタプリタがこのメソッドを呼び出します。

...BasicObject#singleton_method_removed
を使います。

@param name 削除されたメソッド名が Symbol で渡されます。

//emlist[例][ruby]{
class Foo
def Foo.method_removed(name)
puts "method \"#{name}\" was removed"
end


def foo
end

remove_method :foo
end


# => method "...