80件ヒット
[1-80件を表示]
(0.102秒)
クラス
- Bignum (3)
- Numeric (11)
-
OpenSSL
:: PKey :: EC :: Group (11) - OpenStruct (11)
- Regexp (11)
- Struct (11)
- UnboundMethod (22)
検索結果
先頭5件
-
Struct
# eql?(other) -> bool (21117.0) -
self と other のクラスが同じであり、各メンバが eql? メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。
...同じであり、各メンバが eql? メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。
@param other self と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
Dog = Struct.new(:name, :age)
dog1 = Dog.ne......= dog2 #=> true
p dog1.eql?(dog2) #=> true
p dog1.equal?(dog2) #=> false
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作......成する点に
注意してください。
@see Struct#==... -
Numeric
# eql?(other) -> bool (21107.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#===... -
OpenStruct
# eql?(other) -> bool (21107.0) -
self と other が等しい場合に true を返します。そうでない場合は false を 返します。
...等しい場合に true を返します。そうでない場合は false を
返します。
具体的には other が OpenStruct オブジェクトかそのサブクラスでかつ、
self の各要素を保持した内部の Hash が eql? で比較して等しい場合に
true を返します。... -
Bignum
# eql?(other) -> bool (21101.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 (21101.0) -
自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。
...合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
a = String.instance_method(:size)
b = String.instance_method(:size)
p a == b #=> true
c = Ar... -
OpenSSL
:: PKey :: EC :: Group # eql?(other) -> bool (18101.0) -
自身が other と等しいときは true を返します。
...自身が other と等しいときは true を返します。
@param other 比較対象の OpenSSL::PKey::EC::Group オブジェクト... -
Regexp
# eql?(other) -> bool (15107.0) -
otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。
...ら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 (6007.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
//}...