種類
- インスタンスメソッド (157)
- 文書 (59)
- ライブラリ (11)
- クラス (11)
ライブラリ
- ビルトイン (102)
- bigdecimal (11)
- fiddle (11)
- ipaddr (11)
- matrix (11)
- openssl (11)
-
rubygems
/ version (11)
クラス
- BigDecimal (11)
- Bignum (3)
-
Fiddle
:: Pointer (11) -
Gem
:: Version (11) - Hash (11)
- IPAddr (11)
- Matrix (11)
- Method (11)
- Numeric (11)
-
OpenSSL
:: PKey :: EC :: Point (11) - Regexp (11)
- String (22)
- Time (11)
- UnboundMethod (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 3
. 0 . 0 (4) - Numeric (11)
- Ruby用語集 (11)
- assoc (11)
- hash (33)
-
irb
/ completion (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 9 feature (11)
検索結果
先頭5件
-
Numeric
# eql?(other) -> bool (27306.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?, Object#eql?, Object#==, Object#===... -
Bignum
# eql?(other) -> bool (27300.0) -
self と other のクラスが等しくかつ同じ値である場合に true を返します。 そうでない場合に false を返します。
...self と other のクラスが等しくかつ同じ値である場合に true を返します。
そうでない場合に false を返します。
@param other self と比較したい数値。
(1 << 64) == (1 << 64).to_f # => true
(1 << 64).eql?((1 << 64).to_f) # => false... -
Gem
:: Version # eql?(other) -> bool (27300.0) -
self と other の Gem::Version#version のバージョンが等しいとき true を返します。 そうでなければ false を返します。
...self と other の Gem::Version#version のバージョンが等しいとき true を返します。
そうでなければ false を返します。
Comparable を include して作られた == と異なり、"1.0" と "1" は異なるものと判定します。
//emlist[][ruby]{
ver0 = Gem::Versio......n.create('1.0') # #<Gem::Version "1.0">
ver1 = Gem::Version.create('1.0') # #<Gem::Version "1.0">
ver2 = Gem::Version.create('1') # #<Gem::Version "1">
p ver0.eql?(ver1) # => true
p ver1.eql?(ver2) # => false
p ver1 == ver2 # => true
//}... -
IPAddr
# eql?(other) -> bool (27300.0) -
自身が other と等しい場合は真を返します。 そうでない場合は偽を返します。
...自身が other と等しい場合は真を返します。
そうでない場合は偽を返します。
@see Object#eql?... -
String
# eql?(other) -> bool (27300.0) -
文字列の内容が文字列 other の内容と等しいときに true を返します。 等しくなければ false を返します。
...字列 other の内容と等しいときに true を返します。
等しくなければ false を返します。
このメソッドは文字列の内容を比較します。
同一のオブジェクトかどうかを比較するわけではありません。
つまり、"string".eql?(str) とい......string" という内容の文字列でありさえすれば常に true を返します。
同一のオブジェクトであるかどうかを判定したいときは
Object#equal? を使ってください。
アルファベットの大文字小文字を無視して比較したい場合は、String#......case,
String#downcase で大文字小文字を揃えてから比較してください。
Hash クラス内での比較に使われます。
@param other 任意のオブジェクト
@return true か false
//emlist[例][ruby]{
p "string".eql?("string") # => true
p "string".eql?("STRING"......ring" という内容の文字列でありさえすれば常に true を返します。
同一のオブジェクトであるかどうかを判定したいときは
Object#equal? を使ってください。
アルファベットの大文字小文字を無視して比較したい場合は
String#case......@param other 任意のオブジェクト
@return true か false
//emlist[例][ruby]{
p "string".eql?("string") # => true
p "string".eql?("STRING") # => false
p "string".eql?("") # => false
p "".eql?("string") # => false
p "string".eql?("str" + "ing") # => true (内... -
Time
# eql?(other) -> bool (27300.0) -
other が Time かそのサブクラスのインスタンスであり自身と時刻が等しい場合に true を返します。そうでない場合に false を返します。
...other が Time かそのサブクラスのインスタンスであり自身と時刻が等しい場合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したい時刻を Time オブジェクトを指定します。
//emlist[][ruby]{
p Time.lo......cal(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 (24300.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 (24300.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 (24300.0) -
自身が other と等しいならば true を返します。
...自身が other と等しいならば true を返します。
@raise OpenSSL::PKey::EC::Point::Error エラーが生じた場合に発生します... -
Regexp
# eql?(other) -> bool (21312.0) -
otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。
...erが同じパターン、オプション、文字コードの正規表現であったら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
//}...