るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. _builtin ==
  2. openssl ==
  3. rexml/document ==
  4. matrix ==
  5. == _builtin

ライブラリ

キーワード

検索結果

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

Pathname#eql?(other) -> bool (63358.0)

パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。

パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。
other は Pathname オブジェクトでなければなりません。

パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。

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

//emlist[例][ruby]{
require 'pathname'

p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar"...

Fiddle::Pointer#eql?(other) -> bool (63340.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

Gem::Version#eql?(other) -> bool (63340.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...

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

絞り込み条件を変える

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

OpenSSL::BN#eql?(other) -> bool (63304.0)

自身と other が等しい場合に true を返します。

自身と other が等しい場合に true を返します。

@param other 比較する数

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

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

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

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

OpenSSL::PKey::EC::Point#eql?(other) -> bool (63304.0)

自身が other と等しいならば true を返します。

自身が other と等しいならば true を返します。

@raise OpenSSL::PKey::EC::Point::Error エラーが生じた場合に発生します

String#hash -> Integer (9370.0)

self のハッシュ値を返します。 eql? で等しい文字列は、常にハッシュ値も等しくなります。

self のハッシュ値を返します。
eql? で等しい文字列は、常にハッシュ値も等しくなります。

//emlist[例][ruby]{
"test".hash # => 4038258770210371295
("te" + "st").hash == "test".hash # => true
//}

@see Hash

絞り込み条件を変える

UnboundMethod#hash -> Integer (9340.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
//}

Hash#assoc(key) -> Array | nil (340.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...

Method#hash -> Integer (340.0)

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

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


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