33件ヒット
[1-33件を表示]
(0.343秒)
検索結果
先頭3件
-
BasicObject
# singleton _ method _ removed(name) -> object (29207.0) -
特異メソッドが Module#remove_method に より削除された時にインタプリタから呼び出されます。
...bol で渡されます。
//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_removed,B......asicObject#singleton_method_added,BasicObject#singleton_method_undefined... -
BasicObject
# singleton _ method _ added(name) -> object (11106.0) -
特異メソッドが追加された時にインタプリタから呼び出されます。
...ymbol で渡されます。
//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,BasicObje... -
BasicObject
# singleton _ method _ undefined(name) -> object (11106.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
...ド名が 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}
#=> single......ton method "foo" was undefined
# singleton method "bar" was undefined
//}
@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef...