144件ヒット
[101-144件を表示]
(0.095秒)
別のキーワード
ライブラリ
- ビルトイン (144)
キーワード
- != (12)
- == (12)
-
_ _ send _ _ (24) - equal? (12)
-
instance
_ eval (24) -
instance
_ exec (12) -
method
_ missing (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12)
検索結果
先頭4件
-
BasicObject
# equal?(other) -> bool (3026.0) -
オブジェクトが other と同一であれば真を、さもなくば偽を返します。
...。
ただし、 BasicObject の位置づけ上、どうしても再定義が必要な用途もあるでしょう。
再定義する際には自分が何をしているのかよく理解してから実行してください。
@param other 比較対象となるオブジェクト
@return other が se......さもなくば偽
//emlist[例][ruby]{
original = "a"
copied = original.dup
substituted = original
original == copied #=> true
original == substituted #=> true
original.equal? copied #=> false
original.equal? substituted #=> true
//}
@see Object#equal?, Object#==, Object#eql?... -
BasicObject
# singleton _ method _ added(name) -> object (3020.0) -
特異メソッドが追加された時にインタプリタから呼び出されます。
...ます。
@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#m......ethod_added,BasicObject#singleton_method_removed,BasicObject#singleton_method_undefined... -
BasicObject
# singleton _ method _ removed(name) -> object (3020.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
remove_method :foo
end
#=> singleton method "foo" was removed
//}
@see Module#method_removed,BasicObject#singleton_method_added,BasicObject#singleton_method_undefined... -
BasicObject
# singleton _ method _ undefined(name) -> object (3020.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
...プリタから呼び出されます。
通常のメソッドの未定義に対するフックには
Module#method_undefined を使います。
@param name 未定義にされたメソッド名が Symbol で渡されます。
//emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)......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...