ライブラリ
- ビルトイン (290)
- bigdecimal (24)
- openssl (24)
-
shell
/ filter (6) -
webrick
/ httpversion (12)
クラス
- Array (44)
- BigDecimal (24)
- Bignum (3)
- Complex (12)
- Fixnum (3)
- Float (24)
- Hash (10)
- Integer (12)
- Module (12)
- Numeric (62)
- Object (12)
-
OpenSSL
:: BN (24) - Range (24)
-
Shell
:: Filter (6) - Symbol (12)
-
WEBrick
:: HTTPVersion (12)
モジュール
- Comparable (24)
- Enumerable (36)
キーワード
- < (12)
- <=> (63)
- between? (12)
- bsearch (48)
-
bsearch
_ index (20) -
chunk
_ while (12) - cmp (12)
-
slice
_ before (24) - step (62)
- | (6)
検索結果
先頭5件
-
Comparable
# <=(other) -> bool (21319.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が負の整数か 0 を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。
... <=> をもとにオブジェクト同士を比較します。
<=> が負の整数か 0 を返した場合に、true を返します。
それ以外の整数を返した場合に、false を返します。
@param other 自身と比較したいオブジェクトを指定します。
@raise ArgumentE......rror <=> が nil を返したときに発生します。
//emlist[例][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}... -
Integer
# <=(other) -> bool (21319.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...ram other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
/... -
Float
# <=(other) -> bool (21307.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
3.14 < 3.1415 # => true
3.14 <= 3.1415 # => true
//}... -
BigDecimal
# <=(other) -> bool (21301.0) -
self が other より小さいか等しい場合に true を、そうでない場合に false を返します。
...self が other より小さいか等しい場合に true を、そうでない場合に false
を返します。... -
Module
# <=(other) -> bool | nil (18337.0) -
比較演算子。self が other の子孫であるか、self と other が 同一クラスである場合、 true を返します。 self が other の先祖である場合、false を返します。
...算子。self が other の子孫であるか、self と other が
同一クラスである場合、 true を返します。
self が other の先祖である場合、false を返します。
継承関係にないクラス同士の比較では
nil を返します。
@param other 比較対象のモ......e TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo <= Bar # => false
Bar <= Foo # => true
Baz.ancestors # => [Foo, B......az]
Foo <= Baz # => false
Baz <= Foo # => true
Foo <= Foo # => true
Foo <= Object # => nil
//}... -
Hash
# <=(other) -> bool (18331.0) -
self が other のサブセットか同じである場合に真を返します。
...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... -
Complex
# <=(other) -> bool (18301.0) -
@undef
@undef -
Fixnum
# <=(other) -> bool (18301.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...演算子。数値として等しいまたは小さいか判定します。
@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。... -
Object
# <=>(other) -> 0 | nil (12213.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#===... -
Comparable
# between?(min , max) -> bool (12207.0) -
比較演算子 <=> をもとに self が min と max の範囲内(min, max を含みます)にあるかを判断します。
...比較演算子 <=> をもとに self が min と max の範囲内(min, max
を含みます)にあるかを判断します。
以下のコードと同じです。
//emlist[][ruby]{
self >= min and self <= max
//}
@param min 範囲の下端を表すオブジェクトを指定します。
@param m......raise ArgumentError self <=> min か、self <=> max が nil を返
したときに発生します。
//emlist[例][ruby]{
3.between?(1, 5) # => true
6.between?(1, 5) # => false
'cat'.between?('ant', 'dog') # => true
'gnu'.between?('ant', 'dog') #...