るりまサーチ

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

別のキーワード

  1. _builtin dup
  2. singleton dup
  3. etc sc_re_dup_max
  4. set dup
  5. bigdecimal dup

ライブラリ

クラス

検索結果

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

オブジェクトが other と同一であれば真を、そうでない場合は偽を返します。

...のであるかどうかを判定します。
一般にはこのメソッドを決して再定義すべきでありません。
ただし、 BasicObject の位置づけ上、どうしても再定義が必要な用途もあるでしょう。
再定義する際には自分が何をしているのか...
...ない場合は偽

//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?...