別のキーワード
検索結果
先頭5件
-
Module
# method _ removed(name) -> () (18119.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
e... -
BasicObject
# singleton _ method _ removed(name) -> object (6131.0) -
特異メソッドが Module#remove_method に より削除された時にインタプリタから呼び出されます。
...は
Module#method_removedを使います。
@param name 削除されたメソッド名が 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
re......move_method :foo
end
#=> singleton method "foo" was removed
//}
@see Module#method_removed,BasicObject#singleton_method_added,BasicObject#singleton_method_undefined... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (300.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...よくわかりません(^^;
class << Object
p [self.id, self]
class << self
p [self.id, self]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]
[537742484, Class]
=> ruby 1.7.3 (2002-09......-05) [i586-linux]
[537771634, #<Class:Object>]
[537771634, #<Class:Object>]
さらに、オブジェクトの特異クラスのスーパークラスの特異クラスと
オブジェクトの特異クラスの特異クラスのスーパークラスは同じなのだそう......ばれるhook
: ((<Module#method_removed|Module/method_removed>)) [new]
: ((<Module#method_undefined|Module/method_undefined>)) [new]
追加
=== NameError
: ((<NameError#name|NameError/name>)) [new]
追加
=== NilClass
: ((<NilClass#to_f|NilClass/to_f>)) [new]
追加... -
BasicObject
# singleton _ method _ undefined(name) -> object (18.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}
#=>......singleton 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... -
BasicObject
# singleton _ method _ added(name) -> object (12.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_u...