別のキーワード
ライブラリ
- ビルトイン (299)
- date (11)
- fiddle (11)
-
fiddle
/ import (11) - ipaddr (11)
- openssl (44)
- pathname (11)
-
rubygems
/ dependency (11) -
rubygems
/ version (11) -
webrick
/ httpversion (11)
クラス
- Array (44)
- Complex (5)
- Date (11)
-
Fiddle
:: Pointer (11) -
File
:: Stat (11) -
Gem
:: Dependency (11) -
Gem
:: Version (11) - IPAddr (11)
- Module (11)
- Numeric (11)
-
OpenSSL
:: BN (22) -
OpenSSL
:: X509 :: Name (22) - Pathname (11)
- Range (39)
- String (11)
- Symbol (11)
- Time (11)
-
WEBrick
:: HTTPVersion (11)
モジュール
- Comparable (79)
- Enumerable (66)
-
Fiddle
:: Importer (11)
検索結果
先頭5件
-
Complex
# <=>(other) -> -1 | 0 | 1 | nil (21147.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
//}... -
Pathname
# <=>(other) -> -1 | 0 | 1 | nil (21137.0) -
パス名を比較します。other と同じなら 0 を、ASCII順で self が大きい場合 は正、other が大きい場合は負を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
...。
other は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の 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
//}... -
OpenSSL
:: BN # <=>(other) -> -1 | 0 | 1 (21125.0) -
自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 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 TypeError 比較できない......ときに発生します。
@see OpenSSL::BN#ucmp... -
WEBrick
:: HTTPVersion # <=>(other) -> -1 | 0 | 1 | nil (21107.0) -
自身と指定された other のバージョンを比較します。 自身が other より新しいなら 1、同じなら 0、古いなら -1 を返します。 比較できない場合に nil を返します。
...を返します。
比較できない場合に nil を返します。
@param other HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトか文字列を指定します。
require 'webrick'
v = WEBrick::HTTPVersion.new('1.1')
p v < '1.0' #=> false... -
Fiddle
:: Pointer # <=>(other) -> Integer (21101.0) -
ポインタの指すアドレスの大小を比較します。
...ポインタの指すアドレスの大小を比較します。
other より小さい場合は -1, 等しい場合は 0、other より大きい場合は
1を返します。
@param other 比較対象の Pointer オブジェクト... -
Gem
:: Dependency # <=>(other) -> Integer (21101.0) -
self と other を Gem::Dependency#name の ASCII コードで比較して self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。
...self と other を Gem::Dependency#name の ASCII コードで比較して
self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。... -
IPAddr
# <=>(other) -> Integer | nil (21101.0) -
self と other を比較します。
...比較します。
@param other 比較対象の IPAddr オブジェクト。
@return self と other のアドレスファミリが一致しない場合は nil を返します。
アドレスファミリが一致する場合は、両方の数値表現を Integer#<=>
で比較した......結果を返します。
@see Integer#<=>... -
OpenSSL
:: X509 :: Name # <=>(other) -> -1 | 0 | 1 (21101.0) -
他の OpenSSL::X509::Name オブジェクトと比較します。
...他の OpenSSL::X509::Name オブジェクトと比較します。
自身が other と一致する場合は 0、otherより大きい場合は1、
小さい場合は -1 を返します。
@param other 比較するオブジェクト... -
Time
# <=>(other) -> -1 | 0 | 1 | nil (18197.0) -
self と other の時刻を比較します。self の方が大きい場合は 1 を、等しい場合は 0 を、 小さい場合は -1 を返します。比較できない場合は、nil を返します。
...返します。
@param other 自身と比較したい時刻を Time オブジェクトで指定します。
//emlist[][ruby]{
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 (18179.0) -
self と other を ASCII コード順で比較して、 self が大きい時には 1、等しい時には 0、小さい時には -1 を返します。 このメソッドは Comparable モジュールのメソッドを実装するために使われます。
...ッドは 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" <=> "aaa" # => 1
p "string" <=> "stringAA" # => -1
p "string" <=> "string" # => 0
p "stringAA" <=> "string" # => 1
//}...