ライブラリ
- ビルトイン (510)
- bigdecimal (24)
- date (12)
- fiddle (12)
- ipaddr (12)
- openssl (48)
- pathname (12)
- rake (12)
-
rdoc
/ context (12) -
rexml
/ document (24) -
rubygems
/ dependency (12) -
rubygems
/ version (12) -
shell
/ filter (6) -
webrick
/ httpversion (12)
クラス
- Array (56)
- BigDecimal (24)
- Bignum (3)
- Complex (18)
- Date (12)
-
Fiddle
:: Pointer (12) -
File
:: Stat (12) - Fixnum (6)
- Float (48)
-
Gem
:: Dependency (12) -
Gem
:: Version (12) - Hash (10)
- IPAddr (12)
- Integer (24)
- Module (24)
- Numeric (165)
- Object (12)
-
OpenSSL
:: BN (24) -
OpenSSL
:: X509 :: Name (24) - Pathname (12)
-
RDoc
:: Context (12) -
REXML
:: Comment (12) -
REXML
:: Text (12) -
Rake
:: EarlyTime (12) - Range (24)
- Rational (12)
-
Shell
:: Filter (6) - String (12)
- Symbol (12)
- Time (12)
-
WEBrick
:: HTTPVersion (12)
モジュール
- Comparable (24)
- Enumerable (36)
キーワード
- % (12)
- < (12)
- <=> (312)
- between? (12)
- bsearch (48)
-
bsearch
_ index (20) -
chunk
_ while (12) - cmp (24)
- div (12)
- divmod (24)
- modulo (12)
- remainder (12)
-
slice
_ before (24) - step (93)
- | (6)
検索結果
先頭5件
-
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
//}... -
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 比較対象のモ......@raise 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, Baz]
Foo <= Baz # => false
Baz <= Foo # => true
Foo <= Foo # => true
Foo <= Object # => nil
//}... -
Comparable
# <=(other) -> bool (18319.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が負の整数か 0 を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。
... <=> をもとにオブジェクト同士を比較します。
<=> が負の整数か 0 を返した場合に、true を返します。
それ以外の整数を返した場合に、false を返します。
@param other 自身と比較したいオブジェクトを指定します。
@raise ArgumentE......rror <=> が nil を返したときに発生します。
//emlist[例][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}... -
Hash
# <=(other) -> bool (18319.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... -
BigDecimal
# <=(other) -> bool (18301.0) -
self が other より小さいか等しい場合に true を、そうでない場合に false を返します。
...self が other より小さいか等しい場合に true を、そうでない場合に false
を返します。... -
Complex
# <=(other) -> bool (18301.0) -
@undef
@undef -
Fixnum
# <=(other) -> bool (18301.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...演算子。数値として等しいまたは小さいか判定します。
@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。... -
Time
# <=>(other) -> -1 | 0 | 1 | nil (9486.0) -
self と other の時刻を比較します。self の方が大きい場合は 1 を、等しい場合は 0 を、 小さい場合は -1 を返します。比較できない場合は、nil を返します。
...other の時刻を比較します。self の方が大きい場合は 1 を、等しい場合は 0 を、
小さい場合は -1 を返します。比較できない場合は、nil を返します。
@param other 自身と比較したい時刻を Time オブジェクトで指定します。
//emlist......uby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 2592000 # => 2000-01-31 00:00:00 +0900
p t <=> t2 # => -1
p t2 <=> t # => 1
//}
//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 0.1 # => 2000-01-01 00:......00:00 +0900
p t.nsec # => 0
p t2.nsec # => 100000000
p t <=> t2 # => -1
p t2 <=> t # => 1
p t <=> t # => 0
//}... -
String
# <=>(other) -> -1 | 0 | 1 | nil (9336.0) -
self と other を ASCII コード順で比較して、 self が大きい時には 1、等しい時には 0、小さい時には -1 を返します。 このメソッドは Comparable モジュールのメソッドを実装するために使われます。
...other を ASCII コード順で比較して、
self が大きい時には 1、等しい時には 0、小さい時には -1 を返します。
このメソッドは Comparable モジュールのメソッドを実装するために使われます。
other が文字列でない場合、
other.to_str......と other.<=> が定義されていれば
0 - (other <=> self) の結果を返します。
そうでなければ nil を返します。
@param other 文字列
@return 比較結果の整数か nil
//emlist[例][ruby]{
p "aaa" <=> "xxx" # => -1
p "aaa" <=> "aaa" # => 0
p "xxx" <=> "aa......a" # => 1
p "string" <=> "stringAA" # => -1
p "string" <=> "string" # => 0
p "stringAA" <=> "string" # => 1
//}...