るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.065秒)

別のキーワード

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

クラス

検索結果

Object#equal?(other) -> bool (26124.0)

other が self 自身の時、真を返します。

...other が self 自身の時、真を返します。

二つのオブジェクトが同一のものかどうか調べる時に使用します。
このメソッドを再定義してはいけません。

お互いのObject#object_idが一致する
かどうかを調べます。

@param other 比較...
...するオブジェクトです。

//emlist[][ruby]{
p("foo".equal?("bar")) #=> false
p("foo".equal?("foo")) #=> false

p(4.equal?(4)) #=> true
p(4.equal?(4.0)) #=> false

p(:foo.equal? :foo) #=> true
//}

@see Object#object_id,Object#==,Object#eql?,Symbol...

BasicObject#equal?(other) -> bool (26120.0)

オブジェクトが other と同一であれば真を、さもなくば偽を返します。

...
@return other が self 自身であれば真、さもなくば偽

//emlist[例][ruby]{
original = "a"
copied = original.dup
substituted = original

original == copied #=> true
original == substituted #=> true
original.equal? copied #=> false
original.equal? substituted #=> tru...

Hash#equal?(other) -> bool (26118.0)

指定された other が self 自身である場合のみ真を返します。

...指定された other が self 自身である場合のみ真を返します。

@param other 自身と比較したい Hash オブジェクトを指定します。

//emlist[例][ruby]{
p({}.equal?({})) #=> false
a = {}
p a.equal?(a) #=> true
//}

@see Hash#==...

Struct#equal?(other) -> bool (26118.0)

指定された other が self 自身である場合のみ真を返します。 これは Object クラスで定義されたデフォルトの動作で す。

...指定された other が self 自身である場合のみ真を返します。
これは Object クラスで定義されたデフォルトの動作で
す。

[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。S...