ライブラリ
- ビルトイン (671)
- bigdecimal (12)
- date (12)
- fiddle (12)
-
fiddle
/ import (12) - ipaddr (12)
- openssl (48)
- pathname (12)
- rake (12)
-
rdoc
/ context (12) -
rexml
/ document (24) -
rubygems
/ dependency (12) -
rubygems
/ version (12) -
webrick
/ httpversion (12)
クラス
- Array (108)
- BigDecimal (12)
- Bignum (3)
- Complex (6)
- Date (12)
-
Fiddle
:: Pointer (12) -
File
:: Stat (12) - Fixnum (3)
- Float (12)
-
Gem
:: Dependency (12) -
Gem
:: Version (12) - IPAddr (12)
- Integer (12)
- Module (12)
- Numeric (12)
- Object (12)
-
OpenSSL
:: BN (24) -
OpenSSL
:: X509 :: Name (24) - Pathname (12)
-
RDoc
:: Context (12) -
REXML
:: Comment (12) -
REXML
:: Text (12) -
Rake
:: EarlyTime (12) - Range (104)
- Rational (12)
- String (12)
- Symbol (12)
- Time (12)
-
WEBrick
:: HTTPVersion (12)
モジュール
- Comparable (87)
- Enumerable (240)
-
Fiddle
:: Importer (12)
検索結果
先頭5件
-
String
# <=>(other) -> -1 | 0 | 1 | nil (24343.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
//}... -
Rational
# <=>(other) -> -1 | 0 | 1 | nil (24337.0) -
self と other を比較して、self が大きい時に 1、等しい時に 0、小さい時に -1 を返します。比較できない場合はnilを返します。
...ther を比較して、self が大きい時に 1、等しい時に 0、小さい時に
-1 を返します。比較できない場合はnilを返します。
@param other 自身と比較する数値
@return -1 か 0 か 1 か nil を返します。
//emlist[例][ruby]{
Rational(2, 3) <=> Rat......ional(2, 3) # => 0
Rational(5) <=> 5 # => 0
Rational(2, 3) <=> Rational(1,3) # => 1
Rational(1, 3) <=> 1 # => -1
Rational(1, 3) <=> 0.3 # => 1
Rational(1, 3) <=> nil # => nil
//}... -
Integer
# <=>(other) -> -1 | 0 | 1 | nil (24325.0) -
self と other を比較して、self が大きい時に1、等しい時に 0、小さい時 に-1、比較できない時に nil を返します。
...ther を比較して、self が大きい時に1、等しい時に 0、小さい時
に-1、比較できない時に nil を返します。
@param other 比較対象の数値
@return -1 か 0 か 1 か nil のいずれか
//emlist[][ruby]{
1 <=> 2 # => -1
1 <=> 1 # => 0
2 <=> 1 # => 1
2 <=>... -
Fiddle
:: Pointer # <=>(other) -> Integer (24301.0) -
ポインタの指すアドレスの大小を比較します。
...ポインタの指すアドレスの大小を比較します。
other より小さい場合は -1, 等しい場合は 0、other より大きい場合は
1を返します。
@param other 比較対象の Pointer オブジェクト... -
RDoc
:: Context # <=>(other) -> -1 | 0 | 1 (24301.0) -
自身と other の full_name を比較した結果を返します。
...自身と other の full_name を比較した結果を返します。
ソートのために使われます。
@param other 自身と比較したいオブジェクトを指定します。... -
REXML
:: Comment # <=>(other) -> -1 | 0 | 1 (24301.0) -
other と内容(REXML::Comment#string)を比較します。
...other と内容(REXML::Comment#string)を比較します。... -
REXML
:: Text # <=>(other) -> -1 | 0 | 1 (24301.0) -
テキストの内容を other と比較します。
...テキストの内容を other と比較します。
@param other 比較対象(REXML::Text オブジェクトもしくは文字列)... -
Rake
:: EarlyTime # <=>(other) -> -1 (24301.0) -
必ず -1 を返します。
...必ず -1 を返します。
@param other 比較対象のオブジェクト
@return -1 を返します。... -
WEBrick
:: HTTPVersion # <=>(other) -> -1 | 0 | 1 | nil (24301.0) -
自身と指定された other のバージョンを比較します。 自身が other より新しいなら 1、同じなら 0、古いなら -1 を返します。 比較できない場合に nil を返します。
...身と指定された other のバージョンを比較します。
自身が other より新しいなら 1、同じなら 0、古いなら -1 を返します。
比較できない場合に nil を返します。
@param other HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクト......か文字列を指定します。
require 'webrick'
v = WEBrick::HTTPVersion.new('1.1')
p v < '1.0' #=> false...