るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. util u
  2. erb u
  3. matrix u
  4. _builtin koi8_u
  5. encoding koi8_u

ライブラリ

検索結果

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

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

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

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

//emlist[例][ruby]{
Dog = Struct.new(:name, :age)
dog1 = Dog.new("fred", 5)
dog2 = Dog.new("fred", 5)

p dog1 == dog2 #=> true
p dog1.eql?(dog2) #=> ...

Numeric#eql?(other) -> bool (63322.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?, ...

OpenStruct#eql?(other) -> bool (63322.0)

self と other が等しい場合に true を返します。そうでない場合は false を 返します。

self と other が等しい場合に true を返します。そうでない場合は false を
返します。

具体的には other が OpenStruct オブジェクトかそのサブクラスでかつ、
self の各要素を保持した内部の Hash が eql? で比較して等しい場合に
true を返します。

@param other 比較対象のオブジェクトを指定します。

Bignum#eql?(other) -> bool (63304.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

UnboundMethod#eql?(other) -> bool (63304.0)

自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。

自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に
true を返します。そうでない場合に false を返します。

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

//emlist[例][ruby]{
a = String.instance_method(:size)
b = String.instance_method(:size)
p a == b #=> true

c = Array.instance_method(:size)
p a == c ...

絞り込み条件を変える

OpenSSL::PKey::EC::Group#eql?(other) -> bool (54304.0)

自身が other と等しいときは true を返します。

自身が other と等しいときは true を返します。

@param other 比較対象の OpenSSL::PKey::EC::Group オブジェクト

Regexp#eql?(other) -> bool (45322.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
//}

UnboundMethod#hash -> Integer (18022.0)

自身のハッシュ値を返します。

自身のハッシュ値を返します。


//emlist[例][ruby]{
a = method(:==).unbind
b = method(:eql?).unbind
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}