49件ヒット
[1-49件を表示]
(0.099秒)
種類
- インスタンスメソッド (38)
- クラス (11)
検索結果
先頭5件
-
Data
# eql?(other) -> bool (26140.0) -
self と other のクラスが同じであり、各メンバが eql? メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。
...
self と other のクラスが同じであり、各メンバが eql? メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。
@param other self と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
Dog = Data.d......efine(:name, :age)
dog1 = Dog.new("Fred", 5)
dog2 = Dog.new("Fred", 5)
p dog1 == dog2 # => true
p dog1.eql?(dog2) # => true
p dog1.equal?(dog2) # => false
//}
[注意] 本メソッドの記述は Data のサブクラスのインスタンスに対して呼び......出す事を想定しています。Data.define は Data のサブクラスを作成する点に
注意してください。
@see Object#eql?, Data#==... -
Struct
# eql?(other) -> bool (26140.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) #=> true
p dog1.equal?(dog2) #=> false
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出... -
Bignum
# eql?(other) -> bool (26124.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 (23118.0) -
self と other のマッチ対象になった文字列、元になった正規表現オブジェク ト、マッチした位置が等しければ true を返します。そうでない場合には false を返します。
...
self と other のマッチ対象になった文字列、元になった正規表現オブジェク
ト、マッチした位置が等しければ true を返します。そうでない場合には
false を返します。
@param other 比較対象のオブジェクトを指定します。
//emlis... -
Numeric (8062.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...o o - -
downto | - o - - - - -
eql? | o - - o o - o
even? | - o o......**d
if self > 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end
def rounddown(d=0)
x = 10**d
if self < 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end
def roundoff(d=0)
x = 10**d
if self < 0
(self.quo(x) -......0.5).ceil * x
else
(self.quo(x) + 0.5).floor * x
end
end
end
//}......divmod | o o o - -
downto | - o - - -
eql? | o - o - o
even? | - o - - -... -
String
# hash -> Integer (8034.0) -
self のハッシュ値を返します。 eql? で等しい文字列は、常にハッシュ値も等しくなります。
...
self のハッシュ値を返します。
eql? で等しい文字列は、常にハッシュ値も等しくなります。
//emlist[例][ruby]{
"test".hash # => 4038258770210371295
("te" + "st").hash == "test".hash # => true
//}
@see Hash...