るりまサーチ

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

別のキーワード

  1. argf.class lines
  2. argf.class each_line
  3. argf.class each
  4. argf.class set_encoding
  5. argf.class readline

ライブラリ

クラス

検索結果

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

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

...ドが 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 "foo" was removed
//}...

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

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

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

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

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

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

BasicObject#singleton_method_undefined(name) -> object (6224.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...

BasicObject#singleton_method_added(name) -> object (6218.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...