ライブラリ
- ビルトイン (647)
- bigdecimal (11)
- date (11)
- fiddle (33)
-
fiddle
/ import (11) - ipaddr (11)
- openssl (44)
- pathname (11)
- rake (11)
-
rexml
/ document (22) -
rubygems
/ version (11) -
webrick
/ httpversion (11)
クラス
- Array (65)
- BigDecimal (11)
- Bignum (3)
- Complex (5)
- Date (11)
-
Fiddle
:: Pointer (11) -
File
:: Stat (11) - Float (11)
-
Gem
:: Version (11) - IPAddr (11)
- Integer (11)
- Module (11)
- Numeric (22)
- Object (11)
-
OpenSSL
:: BN (22) -
OpenSSL
:: X509 :: Name (22) - Pathname (11)
-
REXML
:: Comment (11) -
REXML
:: Text (11) -
Rake
:: EarlyTime (11) - Range (99)
- Rational (11)
- String (11)
- Symbol (11)
- Time (11)
-
WEBrick
:: HTTPVersion (11)
モジュール
- Comparable (79)
- Enumerable (264)
-
Fiddle
:: Importer (11)
キーワード
- < (11)
- <= (11)
- == (11)
- === (5)
- > (11)
- >= (11)
- BlockCaller (11)
- Closure (11)
- Comparable (11)
- Ruby用語集 (11)
- between? (11)
- bind (11)
- clamp (13)
- cmp (22)
- cover? (17)
- fiddle (11)
-
fiddle
/ import (11) - include? (11)
- max (82)
-
max
_ by (44) - member? (11)
- min (82)
-
min
_ by (44) - minmax (22)
-
minmax
_ by (22) - new (11)
- nonzero? (11)
- sort (22)
- sort! (22)
-
sort
_ by (22)
検索結果
先頭5件
-
Complex
# <=>(other) -> -1 | 0 | 1 | nil (21246.0) -
self の虚部がゼロで other が実数の場合、 self の実部の <=> メソッドで other と比較した結果を返します。 other が Complex で虚部がゼロの場合も同様です。
...self の虚部がゼロで other が実数の場合、
self の実部の <=> メソッドで other と比較した結果を返します。
other が Complex で虚部がゼロの場合も同様です。
その他の場合は nil を返します。
@param other 自身と比較する数値
//emlis......t[例][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
//}... -
Module
# <=>(other) -> Integer | nil (21236.0) -
self と other の継承関係を比較します。
...elf と other の継承関係を比較します。
self と other を比較して、
self が other の子孫であるとき -1、
同一のクラス/モジュールのとき 0、
self が other の先祖であるとき 1
を返します。
継承関係にないクラス同士の比較では
nil......nil を返します。
@param 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
//}... -
Rational
# <=>(other) -> -1 | 0 | 1 | nil (21236.0) -
self と other を比較して、self が大きい時に 1、等しい時に 0、小さい時に -1 を返します。比較できない場合はnilを返します。
...self と other を比較して、self が大きい時に 1、等しい時に 0、小さい時に
-1 を返します。比較できない場合はnilを返します。
@param other 自身と比較する数値
@return -1 か 0 か 1 か nil を返します。
//emlist[例][ruby]{
Rational(2,......3) <=> Rational(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
//}... -
Float
# <=>(other) -> -1 | 0 | 1 | nil (21230.0) -
self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。 比較できない場合はnilを返します
...self と other を比較して、self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。
比較できない場合はnilを返します
//emlist[例][ruby]{
3.05 <=> 3.14 # => -1
1.732 <=> 1.414 # => 1
3.3 - 3.3 <=> 0.0 # => 0
3.14 <=> "hoge" # => nil......3.14 <=> 0.0/0.0 # => nil
//}... -
Symbol
# <=>(other) -> -1 | 0 | 1 | nil (21224.0) -
self と other のシンボルに対応する文字列を ASCII コード順で比較して、 self が小さい時には -1、等しい時には 0、大きい時には 1 を返します。
...self と other のシンボルに対応する文字列を ASCII コード順で比較して、
self が小さい時には -1、等しい時には 0、大きい時には 1 を返します。
other がシンボルではなく比較できない時には nil を返します。
@param other 比較対......象のシンボルを指定します。
//emlist[][ruby]{
p :aaa <=> :xxx # => -1
p :aaa <=> :aaa # => 0
p :xxx <=> :aaa # => 1
p :foo <=> "foo" # => nil
//}
@see String#<=>, Symbol#casecmp... -
File
:: Stat # <=>(o) -> Integer | nil (21218.0) -
ファイルの最終更新時刻を比較します。self が other よりも 新しければ正の数を、等しければ 0 を古ければ負の数を返します。 比較できない場合は nil を返します。
...self が other よりも
新しければ正の数を、等しければ 0 を古ければ負の数を返します。
比較できない場合は 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::Stat.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
//}... -
BigDecimal
# <=>(other) -> -1 | 0 | 1 | nil (21200.0) -
self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。
...self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には
-1 をそれぞれ返します。
self と other が比較できない場合には nil を返します。... -
OpenSSL
:: BN # <=>(other) -> -1 | 0 | 1 (21124.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 TypeError 比較できないときに発生します。
@see OpenSSL::BN#ucmp... -
Fiddle
:: Pointer # <=>(other) -> Integer (21100.0) -
ポインタの指すアドレスの大小を比較します。
ポインタの指すアドレスの大小を比較します。
other より小さい場合は -1, 等しい場合は 0、other より大きい場合は
1を返します。
@param other 比較対象の Pointer オブジェクト -
OpenSSL
:: X509 :: Name # <=>(other) -> -1 | 0 | 1 (21100.0) -
他の OpenSSL::X509::Name オブジェクトと比較します。
...他の OpenSSL::X509::Name オブジェクトと比較します。
自身が other と一致する場合は 0、otherより大きい場合は1、
小さい場合は -1 を返します。
@param other 比較するオブジェクト...