るりまサーチ

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

別のキーワード

  1. _builtin eql?
  2. matrix eql?
  3. openssl eql?
  4. ipaddr eql?

ライブラリ

検索結果

Struct#eql?(other) -> bool (18117.0)

self と other のクラスが同じであり、各メンバが eql? メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。

...じであり、各メンバが eql? メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。

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

//emlist[例][ruby]{
Dog = Struct.new(:name, :age)
dog1 = Dog.new("...
...#=> true
p dog1.eql?(dog2) #=> true
p dog1.equal?(dog2) #=> false
//}

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

@see Struct#==...