るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

検索結果

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

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

...には
Module#method_addedを使います。

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

//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...

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

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

...dule#remove_method に
より削除された時にインタプリタから呼び出されます。

通常のメソッドの削除に対するフックには
Module#method_removedを使います。

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

//emlist[例][ruby]{
clas...
...f 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_removed,BasicObject#singleton_method_added,BasicObject#singleton_method...

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

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

...が 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 obj.foo
end
def obj.bar
end

class << obj
undef_method :foo
end
obj.instance_eval {undef bar}

#=> singleton method "foo" was undefined
# singlet...
...on method "bar" was undefined
//}

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

Profiler__ (6012.0)

プロファイラの実装です。 Profiler__.start_profile 実行から、Profiler__.stop_profile までの 区間の実行コードのプロファイルを取得します。

...イラの実装です。
Profiler__.start_profile 実行から、Profiler__.stop_profile までの
区間の実行コードのプロファイルを取得します。

以下の使用例を参照してください。

require 'profiler'

Profiler__.start_profile
require 'tk' # この...
...140.00 140.00 Profiler__.start_profile
4.23 1.89 0.09 15 6.00 10.67 Kernel.extend
3.29 1.96 0.07 15 4.67 4.67 Module#extend_object
3.29 2.03 0.07 133 0.53 0.53 Kernel.singleton_method_added
2.82 2.09...
...ule#attr
1.88 2.13 0.04 19 2.11 2.11 Module#private
1.41 2.16 0.03 29 1.03 1.38 Module#include
0.94 2.18 0.02 10 2.00 4.00 Module#module_function
0.94 2.20 0.02 2 10.00 10.00 Array#coll...

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

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

...す。

特異メソッドの追加に対するフックには
BasicObject#singleton_method_added
を使います。

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

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

絞り込み条件を変える