るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. dsa p
  5. kernel p

ライブラリ

クラス

キーワード

検索結果

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

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

...が一致する
かどうかを調べます。

@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,Objec...

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

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

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

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

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

@see Hash#==...

Object#==(other) -> bool (31.0)

オブジェクトと other が等しければ真を返します。

...ォルトでは equal? と同じオブジェクト
の同一性判定になっています。

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

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

p
(4 == 4) #=> true
p
(4 == 4.0) #=> true
//}

@see Object#equal?,Object#eql?...

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

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

...ォルトでは equal? と同じオブジェクト
の同一性判定になっています。

このメソッドを再定義した時には Object#hash メソッ
ドも再定義しなければなりません。

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

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

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

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