るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.090秒)

別のキーワード

  1. csv instance
  2. singleton instance
  3. _builtin instance_eval
  4. syslog instance
  5. basicobject instance_eval

ライブラリ

クラス

検索結果

Module#method_added(name) -> () (18126.0)

メソッド name が追加された時にインタプリタがこのメソッドを呼び出します。

...asicObject#singleton_method_added
を使います。

@param name 追加されたメソッドの名前が Symbol で渡されます。

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

def foo
end
define_method :bar, instance_method(:fo...

BasicObject#singleton_method_undefined(name) -> object (6150.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...
...s undefined
//}

@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef...