るりまサーチ

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

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. win32ole_param retval?
  4. win32ole_param name
  5. win32ole_param input?

ライブラリ

クラス

キーワード

検索結果

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

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

...@param 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 #=> true
//}

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

Object#equal?(other) -> bool (18113.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 (18107.0)

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

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

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

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

@see Hash#==...

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

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

...性を判定するように)再定義されることが期待されています。

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

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

//emlist[例][ruby]{
o = Object.new
p(o.eql?(o)) #=> true
p...
...の例のように、各クラスの性質に合わせて再定義されることが期待されています。

//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 (13.0)

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

...場合もあります。

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

このメソッドを再定義した時には 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#==...

絞り込み条件を変える