るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

クラス

検索結果

Struct#eql?(other) -> bool (54424.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) #=> ...

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

MatchData#eql?(other) -> bool (45358.0)

self と other のマッチ対象になった文字列、元になった正規表現オブジェク ト、マッチした位置が等しければ true を返します。そうでない場合には false を返します。

self と other のマッチ対象になった文字列、元になった正規表現オブジェク
ト、マッチした位置が等しければ true を返します。そうでない場合には
false を返します。

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

//emlist[文字列][ruby]{
s = "abc"
m1 = s.match("a")
m2 = s.match("b")
m1 == m2 # => false
m2 = s.match("a")
m1 == m2 # => true
//}

//emlist[正規表現][ruby]{
r = /abc/
m1 = r.mat...

String#hash -> Integer (106.0)

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

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

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

@see Hash