ライブラリ
- ビルトイン (376)
- bigdecimal (24)
- openssl (36)
-
rdoc
/ context (12) -
rexml
/ document (24) -
rubygems
/ dependency (12) -
rubygems
/ version (12) -
shell
/ filter (6) -
webrick
/ httpversion (12)
クラス
- Array (44)
- BigDecimal (24)
- Complex (18)
-
File
:: Stat (12) - Float (12)
-
Gem
:: Dependency (12) -
Gem
:: Version (12) - Hash (10)
- Numeric (165)
- Object (12)
-
OpenSSL
:: BN (12) -
OpenSSL
:: X509 :: Name (24) -
RDoc
:: Context (12) -
REXML
:: Comment (12) -
REXML
:: Text (12) - Range (43)
-
Shell
:: Filter (6) -
WEBrick
:: HTTPVersion (12)
モジュール
- Comparable (24)
- Enumerable (36)
キーワード
- % (12)
- <=> (138)
- between? (12)
- bsearch (48)
-
bsearch
_ index (20) -
chunk
_ while (12) - cmp (24)
- cover? (19)
- div (12)
- divmod (24)
- modulo (12)
- remainder (12)
-
slice
_ before (24) - step (93)
- | (6)
検索結果
先頭5件
-
Comparable
# <=(other) -> bool (21119.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が負の整数か 0 を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。
...比較演算子 <=> をもとにオブジェクト同士を比較します。
<=> が負の整数か 0 を返した場合に、true を返します。
それ以外の整数を返した場合に、false を返します。
@param other 自身と比較したいオブジェクトを指定します。......@raise ArgumentError <=> が nil を返したときに発生します。
//emlist[例][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}... -
BigDecimal
# <=(other) -> bool (21101.0) -
self が other より小さいか等しい場合に true を、そうでない場合に false を返します。
self が other より小さいか等しい場合に true を、そうでない場合に false
を返します。 -
Complex
# <=(other) -> bool (21101.0) -
@undef
@undef -
Hash
# <=(other) -> bool (18125.0) -
self が other のサブセットか同じである場合に真を返します。
...セットか同じである場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 <= h2 # => true
h2 <= h1 # => false
h1 <= h1 # => true
//}
@see Hash#<, Hash#>=, Hash#>... -
BigDecimal
# <=>(other) -> -1 | 0 | 1 | nil (9101.0) -
self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。
self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には
-1 をそれぞれ返します。
self と other が比較できない場合には nil を返します。 -
Complex
# <=>(other) -> -1 | 0 | 1 | nil (9101.0) -
self の虚部がゼロで other が実数の場合、 self の実部の <=> メソッドで other と比較した結果を返します。 other が Complex で虚部がゼロの場合も同様です。
... <=> メソッドで other と比較した結果を返します。
other が Complex で虚部がゼロの場合も同様です。
その他の場合は nil を返します。
@param other 自身と比較する数値
//emlist[例][ruby]{
Complex(2, 3) <=> Complex(2, 3) #=> nil
Complex(2, 3) <=>......1 #=> nil
Complex(2) <=> 1 #=> 1
Complex(2) <=> 2 #=> 0
Complex(2) <=> 3 #=> -1
//}... -
Gem
:: Dependency # <=>(other) -> Integer (9101.0) -
self と other を Gem::Dependency#name の ASCII コードで比較して self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。
...self と other を Gem::Dependency#name の ASCII コードで比較して
self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。... -
Numeric
# <=>(other) -> -1 | 0 | 1 | nil (9101.0) -
自身が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。 自身と other が比較できない場合には nil を返します。
...す。
Numeric のサブクラスは、上の動作を満たすよう このメソッドを適切に再定義しなければなりません。
@param other 自身と比較したい数値を指定します。
//emlist[例][ruby]{
1 <=> 0 #=> 1
1 <=> 1 #=> 0
1 <=> 2 #=> -1
1 <=> "0" #=> nil
/... -
Object
# <=>(other) -> 0 | nil (9101.0) -
self === other である場合に 0 を返します。そうでない場合には nil を返します。
...self === other である場合に 0 を返します。そうでない場合には nil を返します。
//emlist[例][ruby]{
a = Object.new
b = Object.new
a <=> a # => 0
a <=> b # => nil
//}
@see Object#===...