ライブラリ
- ビルトイン (637)
- bigdecimal (24)
- cmath (12)
- date (12)
- fiddle (12)
- ipaddr (12)
- openssl (48)
- pathname (12)
- rake (12)
-
rdoc
/ context (12) -
rexml
/ document (24) -
rubygems
/ dependency (12) -
rubygems
/ requirement (12) -
rubygems
/ version (12) -
shell
/ filter (6) - tracer (24)
-
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
:: Requirement (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 (43)
- Rational (12)
-
Shell
:: Filter (6) - String (12)
- Symbol (12)
- Time (12)
- Tracer (24)
-
WEBrick
:: HTTPVersion (12)
モジュール
- CMath (12)
- Comparable (24)
- Enumerable (36)
- Kernel (72)
- Math (24)
キーワード
- % (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - < (12)
- <=> (312)
- Numeric (12)
- OPS (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- acos (12)
- acos! (6)
- asin (12)
- asin! (6)
- between? (12)
- bsearch (48)
-
bsearch
_ index (20) -
chunk
_ while (12) - cmp (24)
- cover? (19)
- div (12)
- divmod (24)
- fail (36)
- modulo (12)
- openssl (12)
- raise (36)
- remainder (12)
-
ruby 1
. 6 feature (12) -
set
_ get _ line _ procs (24) -
slice
_ before (24) - step (93)
- tsort (12)
- | (6)
- 演算子式 (12)
検索結果
先頭5件
-
IPAddr
# <=>(other) -> Integer | nil (6100.0) -
self と other を比較します。
...の IPAddr オブジェクト。
@return self と other のアドレスファミリが一致しない場合は nil を返します。
アドレスファミリが一致する場合は、両方の数値表現を Integer#<=>
で比較した結果を返します。
@see Integer#<=>... -
Integer
# <=>(other) -> -1 | 0 | 1 | nil (6100.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
//}... -
Module
# <=>(other) -> Integer | nil (6100.0) -
self と other の継承関係を比較します。
...のクラスやモジュール
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar # => -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => nil
p Qux <=> Baz # => nil
p Baz <=> Object.new # => nil
//}... -
Numeric
# <=>(other) -> -1 | 0 | 1 | nil (6100.0) -
自身が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。 自身と other が比較できない場合には nil を返します。
...Numeric のサブクラスは、上の動作を満たすよう このメソッドを適切に再定義しなければなりません。
@param other 自身と比較したい数値を指定します。
//emlist[例][ruby]{
1 <=> 0 #=> 1
1 <=> 1 #=> 0
1 <=> 2 #=> -1
1 <=> "0" #=> nil
//}... -
Object
# <=>(other) -> 0 | nil (6100.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#===... -
OpenSSL
:: BN # <=>(other) -> -1 | 0 | 1 (6100.0) -
自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。
...1 を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new(5) <=> 5 # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}
@param other 比較する整数
@raise TypeErr... -
OpenSSL
:: X509 :: Name # <=>(other) -> -1 | 0 | 1 (6100.0) -
他の OpenSSL::X509::Name オブジェクトと比較します。
他の OpenSSL::X509::Name オブジェクトと比較します。
自身が other と一致する場合は 0、otherより大きい場合は1、
小さい場合は -1 を返します。
@param other 比較するオブジェクト -
Pathname
# <=>(other) -> -1 | 0 | 1 | nil (6100.0) -
パス名を比較します。other と同じなら 0 を、ASCII順で self が大きい場合 は正、other が大きい場合は負を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
...対象の Pathname オブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") <=> Pathname.new("foo/bar")
p Pathname.new("foo/bar") <=> Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") <=> Pathname.new("foo/bar")
# => 0
# 1
# -1
//}... -
RDoc
:: Context # <=>(other) -> -1 | 0 | 1 (6100.0) -
自身と other の full_name を比較した結果を返します。
自身と other の full_name を比較した結果を返します。
ソートのために使われます。
@param other 自身と比較したいオブジェクトを指定します。