るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.012秒)
トップページ > クラス:Object[x] > クエリ:TRUE[x] > クエリ:eql?[x]

別のキーワード

  1. object true
  2. _builtin true
  3. rb_true
  4. true
  5. true object

ライブラリ

検索結果

Object#eql?(other) -> bool (18113.0)

オブジェクトと other が等しければ真を返します。Hash で二つのキー が等しいかどうかを判定するのに使われます。

... Object#hash メソッ
ドも再定義しなければなりません。

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

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

p(4.eql?(4)) #=> true
p(4.eql?(4.0)) #=> false
//}

@see Object#hash,Object#equal?,Object#==...