ライブラリ
- ビルトイン (5)
- bigdecimal (1)
- fiddle (1)
- ipaddr (1)
- matrix (1)
- openssl (1)
-
rubygems
/ version (1)
クラス
- BigDecimal (1)
-
Fiddle
:: Pointer (1) -
Gem
:: Version (1) - Hash (1)
- IPAddr (1)
- Matrix (1)
- Numeric (1)
-
OpenSSL
:: PKey :: EC :: Point (1) - Regexp (1)
- String (1)
- Time (1)
検索結果
先頭5件
-
Numeric
# eql?(other) -> bool (81622.0) -
自身と other のクラスが等しくかつ == メソッドで比較して等しい場合に true を返します。 そうでない場合に false を返します。
自身と other のクラスが等しくかつ == メソッドで比較して等しい場合に true を返します。
そうでない場合に false を返します。
Numeric のサブクラスは、eql? で比較して等しい数値同士が同じハッシュ値を返すように
hash メソッドを適切に定義する必要があります。
@param other 自身と比較したい数値を指定します。
//emlist[例][ruby]{
p 1.eql?(1) #=> true
p 1.eql?(1.0) #=> false
p 1 == 1.0 #=> true
//}
@see Object#equal?, ... -
Gem
:: Version # eql?(other) -> bool (81604.0) -
self と other の Gem::Version#version のバージョンが等しいとき true を返します。 そうでなければ false を返します。
self と other の Gem::Version#version のバージョンが等しいとき true を返します。
そうでなければ false を返します。
Comparable を include して作られた == と異なり、"1.0" と "1" は異なるものと判定します。
//emlist[][ruby]{
ver0 = Gem::Version.create('1.0') # #<Gem::Version "1.0">
ver1 = Gem::Version.create('1.0') # #<Gem::Version "1.0">
ver2 = Gem::Ver... -
IPAddr
# eql?(other) -> bool (81604.0) -
自身が other と等しい場合は真を返します。 そうでない場合は偽を返します。
自身が other と等しい場合は真を返します。
そうでない場合は偽を返します。
@see Object#eql? -
String
# eql?(other) -> bool (81604.0) -
文字列の内容が文字列 other の内容と等しいときに true を返します。 等しくなければ false を返します。
文字列の内容が文字列 other の内容と等しいときに true を返します。
等しくなければ false を返します。
このメソッドは文字列の内容を比較します。
同一のオブジェクトかどうかを比較するわけではありません。
つまり、"string".eql?(str) という式を実行した場合には、
str が "string" という内容の文字列でありさえすれば常に true を返します。
同一のオブジェクトであるかどうかを判定したいときは
Object#equal? を使ってください。
アルファベットの大文字小文字を無視して比較したい場合は
String#casecmp? を使ってくださ... -
Time
# eql?(other) -> bool (81604.0) -
other が Time かそのサブクラスのインスタンスであり自身と時刻が等しい場合に true を返します。そうでない場合に false を返します。
other が Time かそのサブクラスのインスタンスであり自身と時刻が等しい場合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したい時刻を Time オブジェクトを指定します。
//emlist[][ruby]{
p Time.local(2000, 1, 1).eql?(Time.local(2000, 1, 1)) # => true
p Time.local(2000, 1, 1).eql?(Time.local(2000, 1, 2)) # => false
//} -
BigDecimal
# eql?(other) -> bool (72604.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//} -
Fiddle
:: Pointer # eql?(other) -> bool (72604.0) -
ポインタの指すアドレスが同一ならばtrueを返します。
ポインタの指すアドレスが同一ならばtrueを返します。
@param other 比較対象の Pointer オブジェクト
例:
require 'fiddle'
s = 'abc'
cptr = Fiddle::Pointer[s]
cptr0 = Fiddle::Pointer[s]
cptr1 = cptr + 1
p cptr == cptr1 #=> false
p cptr == cptr0 #=> true -
OpenSSL
:: PKey :: EC :: Point # eql?(other) -> bool (72604.0) -
自身が other と等しいならば true を返します。
自身が other と等しいならば true を返します。
@raise OpenSSL::PKey::EC::Point::Error エラーが生じた場合に発生します -
Matrix
# eql?(other) -> bool (63604.0) -
自分自身と other を比較し、同値であれば真(true)を返します。
自分自身と other を比較し、同値であれば真(true)を返します。
@param other 比較対象のオブジェクト -
Regexp
# eql?(other) -> bool (54622.0) -
otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。
otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。
@param other 正規表現を指定します。
//emlist[例][ruby]{
p /^eee$/ == /~eee$/x # => false
p /^eee$/ == /~eee$/i # => false
p /^eee$/e == /~eee$/u # => false
p /^eee$/ == Regexp.new("^eee$") # => true
p /^eee$/.eql?(/^eee$/) # => true
//} -
Hash
# assoc(key) -> Array | nil (622.0) -
ハッシュが key をキーとして持つとき、見つかった要素のキーと値のペア を配列として返します。
ハッシュが key をキーとして持つとき、見つかった要素のキーと値のペア
を配列として返します。
キーの同一性判定には eql? メソッドではなく == メソッドを使います。
key が見つからなかった場合は、nil を返します。
@param key 検索するキー
//emlist[例][ruby]{
h = {"colors" => ["red", "blue", "green"],
"letters" => ["a", "b", "c" ]}
h.assoc("letters") #=> ["letters", ["a", "b", "c"]]
h.assoc("f...