別のキーワード
ライブラリ
- ビルトイン (389)
- date (12)
- fiddle (12)
- ipaddr (12)
- openssl (48)
- pathname (12)
- rake (12)
-
rdoc
/ context (12) -
rexml
/ document (12) -
rubygems
/ version (12) -
shell
/ filter (6) -
webrick
/ httpversion (12)
クラス
- Array (12)
- Bignum (3)
- Complex (6)
- Date (12)
-
Fiddle
:: Pointer (12) -
File
:: Stat (12) - Fixnum (6)
- Float (36)
-
Gem
:: Version (12) - Hash (10)
- IPAddr (12)
- Integer (24)
- Module (24)
- Numeric (165)
-
OpenSSL
:: BN (24) -
OpenSSL
:: X509 :: Name (24) - Pathname (12)
-
RDoc
:: Context (12) -
REXML
:: Text (12) -
Rake
:: EarlyTime (12) - Range (19)
- Rational (12)
-
Shell
:: Filter (6) - String (12)
- Symbol (12)
- Time (12)
-
WEBrick
:: HTTPVersion (12)
モジュール
- Comparable (24)
検索結果
先頭5件
-
Module
# <=(other) -> bool | nil (18143.0) -
比較演算子。self が other の子孫であるか、self と other が 同一クラスである場合、 true を返します。 self が other の先祖である場合、false を返します。
...@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 (18125.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が負の整数か 0 を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。
...比較演算子 <=> をもとにオブジェクト同士を比較します。
<=> が負の整数か 0 を返した場合に、true を返します。
それ以外の整数を返した場合に、false を返します。
@param other 自身と比較したいオブジェクトを指定します。......@raise ArgumentError <=> が nil を返したときに発生します。
//emlist[例][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}... -
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#>... -
Integer
# <=(other) -> bool (18125.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...。
@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # =... -
Float
# <=(other) -> bool (18113.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...ます。
@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
3.14 < 3.1415 # => true
3.14 <= 3.1415 # =... -
Fixnum
# <=(other) -> bool (18107.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...比較演算子。数値として等しいまたは小さいか判定します。
@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返しま... -
Array
# <=>(other) -> -1 | 0 | 1 | nil (6107.0) -
自身と other の各要素をそれぞれ順に <=> で比較していき、結果が 0 でなかった場合に その値を返します。各要素が等しく、配列の長さも等しい場合には 0 を返します。 各要素が等しいまま一方だけ配列の末尾に達した時、自身の方が短ければ -1 をそうでなければ 1 を返します。 other に配列以外のオブジェクトを指定した場合は nil を返します。
...自身と other の各要素をそれぞれ順に <=> で比較していき、結果が 0 でなかった場合に
その値を返します。各要素が等しく、配列の長さも等しい場合には 0 を返します。
各要素が等しいまま一方だけ配列の末尾に達した時、......@param other 自身と比較したい配列を指定します。
配列以外のオブジェクトを指定した場合は to_ary メソッドによ
る暗黙の型変換を試みます。
//emlist[例][ruby]{
[ 1, 2, 3 ] <=> [ 1, 3, 2 ] #=> -1
[ 1, 2, 3 ] <=> [ 1......, 2, 3 ] #=> 0
[ 1, 2, 3 ] <=> [ 1, 2 ] #=> 1
//}... -
Bignum
# <=>(other) -> Fixnum | nil (6107.0) -
self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。
...self と other を比較して、self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。
@param other 比較対象の数値
@return -1 か 0 か 1 のいずれか
1 <=> 2 #=> -1
1 <=> 1 #=> 0
2 <=> 1 #=> 1... -
Complex
# <=>(other) -> -1 | 0 | 1 | nil (6107.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
//}... -
Date
# <=>(other) -> -1 | 0 | 1 | nil (6107.0) -
二つの日付を比較します。 同じ日付なら 0 を、self が other よりあとの日付なら 1 を、 その逆なら -1 を返します。
...e.new(2001, 2, 3) <=> Date.new(2001, 2, 4) # => -1
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 3) # => 0
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 2) # => 1
p Date.new(2001, 2, 3) <=> Object.new # => nil
p Date.new(2001, 2, 3) <=> Rational(4903887, 2) # => 0
//}
@param other 日付オ... -
Fiddle
:: Pointer # <=>(other) -> Integer (6107.0) -
ポインタの指すアドレスの大小を比較します。
...ポインタの指すアドレスの大小を比較します。
other より小さい場合は -1, 等しい場合は 0、other より大きい場合は
1を返します。
@param other 比較対象の Pointer オブジェクト...