ライブラリ
- ビルトイン (501)
- bigdecimal (22)
- cmath (6)
- date (11)
- fiddle (11)
- ipaddr (11)
- pathname (11)
- rake (11)
-
rubygems
/ dependency (11) -
rubygems
/ requirement (11) -
rubygems
/ version (11) -
shell
/ filter (6) - tracer (22)
-
webrick
/ httpversion (11)
クラス
- Array (51)
- BigDecimal (22)
- Bignum (3)
- Complex (5)
- Date (11)
-
Fiddle
:: Pointer (11) -
File
:: Stat (11) - Fixnum (6)
- Float (22)
-
Gem
:: Dependency (11) -
Gem
:: Requirement (11) -
Gem
:: Version (11) - IPAddr (11)
- Integer (22)
- Module (22)
- Numeric (150)
- Object (11)
- Pathname (11)
-
Rake
:: EarlyTime (11) - Range (22)
- Rational (11)
-
Shell
:: Filter (6) - String (11)
- Symbol (11)
- Time (11)
- Tracer (22)
-
WEBrick
:: HTTPVersion (11)
モジュール
- CMath (6)
- Comparable (11)
- Enumerable (33)
- Kernel (66)
- Math (11)
キーワード
- % (11)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - <=> (231)
- Numeric (11)
- OPS (11)
- asin (11)
- asin! (6)
- between? (11)
- bsearch (44)
-
bsearch
_ index (18) -
chunk
_ while (11) - div (11)
- divmod (22)
- fail (33)
- modulo (11)
- raise (33)
- remainder (11)
-
ruby 1
. 6 feature (11) -
set
_ get _ line _ procs (22) -
slice
_ before (22) - step (84)
- tsort (11)
- | (6)
- 演算子式 (11)
検索結果
先頭5件
-
Integer
# <=(other) -> bool (21118.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}... -
BigDecimal
# <=(other) -> bool (21100.0) -
self が other より小さいか等しい場合に true を、そうでない場合に false を返します。
self が other より小さいか等しい場合に true を、そうでない場合に false
を返します。 -
Fixnum
# <=(other) -> bool (21100.0) -
比較演算子。数値として等しいまたは小さいか判定します。
比較演算子。数値として等しいまたは小さいか判定します。
@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。 -
Module
# <=(other) -> bool | nil (18236.0) -
比較演算子。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
pre......pend 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
//}... -
BigDecimal
# <=>(other) -> -1 | 0 | 1 | nil (9200.0) -
self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。
...self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には
-1 をそれぞれ返します。
self と other が比較できない場合には nil を返します。... -
Bignum
# <=>(other) -> Fixnum | nil (9200.0) -
self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。
...self と other を比較して、self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。
@param other 比較対象の数値
@return -1 か 0 か 1 のいずれか
1 <=> 2 #=> -1
1 <=> 1 #=> 0
2 <=> 1 #=> 1... -
Fiddle
:: Pointer # <=>(other) -> Integer (9200.0) -
ポインタの指すアドレスの大小を比較します。
...ポインタの指すアドレスの大小を比較します。
other より小さい場合は -1, 等しい場合は 0、other より大きい場合は
1を返します。
@param other 比較対象の Pointer オブジェクト... -
File
:: Stat # <=>(o) -> Integer | nil (9200.0) -
ファイルの最終更新時刻を比較します。self が other よりも 新しければ正の数を、等しければ 0 を古ければ負の数を返します。 比較できない場合は nil を返します。
...nil を返します。
@param o File::Stat のインスタンスを指定します。
//emlist[][ruby]{
require 'tempfile' # for Tempfile
fp1 = Tempfile.open("first")
fp1.print "古い方\n"
sleep(1)
fp2 = Tempfile.open("second")
fp2.print "新しい方\n"
p File::Stat.new(fp1.path) <=> File::S......tat.new(fp2.path) #=> -1
p File::Stat.new(fp2.path) <=> File::Stat.new(fp1.path) #=> 1
p File::Stat.new(fp1.path) <=> fp2.path #=> nil
//}... -
Fixnum
# <=>(other) -> Fixnum (9200.0) -
self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。
...self と other を比較して、self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。
@param other 比較対象の数値
@return -1 か 0 か 1 のいずれか
1 <=> 2 #=> -1
1 <=> 1 #=> 0
2 <=> 1 #=> 1... -
Gem
:: Version # <=>(other) -> -1 | 0 | 1 | nil (9200.0) -
self と other を比較して、self が小さい時に -1、 等しい時に 0、大きい時に 1 の整数を返します。 また、other が Gem::Version ではなく比較できないとき、 nil を返します。
...ther が Gem::Version ではなく比較できないとき、 nil を返します。
//emlist[][ruby]{
p Gem::Version.new("3.9.0") <=> Gem::Version.new("3.10.0") # => -1
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0.0") # => 0
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0")......# => 0
p Gem::Version.new("3.9.0") <=> "3.9.0" # => nil
//}
@param other 比較対象の Gem::Version のインスタンスを指定します。... -
IPAddr
# <=>(other) -> Integer | nil (9200.0) -
self と other を比較します。
...の IPAddr オブジェクト。
@return self と other のアドレスファミリが一致しない場合は nil を返します。
アドレスファミリが一致する場合は、両方の数値表現を Integer#<=>
で比較した結果を返します。
@see Integer#<=>... -
Integer
# <=>(other) -> -1 | 0 | 1 | nil (9200.0) -
self と other を比較して、self が大きい時に1、等しい時に 0、小さい時 に-1、比較できない時に nil を返します。
...、self が大きい時に1、等しい時に 0、小さい時
に-1、比較できない時に nil を返します。
@param other 比較対象の数値
@return -1 か 0 か 1 か nil のいずれか
//emlist[][ruby]{
1 <=> 2 # => -1
1 <=> 1 # => 0
2 <=> 1 # => 1
2 <=> '' # => nil
//}...