種類
- インスタンスメソッド (189)
- 文書 (55)
- クラス (11)
- 特異メソッド (11)
ライブラリ
- ビルトイン (134)
- bigdecimal (11)
- date (11)
- fiddle (11)
-
fiddle
/ import (11) - ipaddr (11)
-
rdoc
/ context (11) -
rubygems
/ dependency (11)
クラス
- Array (44)
- BigDecimal (11)
- Date (11)
-
Fiddle
:: Pointer (11) -
Gem
:: Dependency (11) - IPAddr (11)
- Module (11)
-
RDoc
:: Context (11) - Range (55)
モジュール
- Comparable (13)
-
Fiddle
:: Importer (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - === (5)
- Numeric (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
- bind (11)
- clamp (13)
- cover? (17)
- include? (11)
- member? (11)
- new (11)
-
ruby 1
. 8 . 3 feature (11) - sort (22)
- sort! (22)
- 演算子式 (11)
検索結果
先頭5件
-
Gem
:: Dependency # <=>(other) -> Integer (27400.0) -
self と other を Gem::Dependency#name の ASCII コードで比較して self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。
...self と other を Gem::Dependency#name の ASCII コードで比較して
self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。... -
Module
# <=>(other) -> Integer | nil (24460.0) -
self と other の継承関係を比較します。
...self と other の継承関係を比較します。
self と other を比較して、
self が other の子孫であるとき -1、
同一のクラス/モジュールのとき 0、
self が other の先祖であるとき 1
を返します。
継承関係にないクラス同士の比較では
n......other がクラスやモジュールでなければ
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
//}... -
Fiddle
:: Pointer # <=>(other) -> Integer (24406.0) -
ポインタの指すアドレスの大小を比較します。
...ポインタの指すアドレスの大小を比較します。
other より小さい場合は -1, 等しい場合は 0、other より大きい場合は
1を返します。
@param other 比較対象の Pointer オブジェクト... -
Date
# <=>(other) -> -1 | 0 | 1 | nil (24354.0) -
二つの日付を比較します。 同じ日付なら 0 を、self が other よりあとの日付なら 1 を、 その逆なら -1 を返します。
...self が other よりあとの日付なら 1 を、
その逆なら -1 を返します。
other は日付オブジェクトか、
天文学的なユリウス日をあらわす数値を指定します。
そうでない場合、比較ができないので nil を返します。
//emlist[][ruby]{
re......quire "date"
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 4) # => -1
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 3) # => 0
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 2) # => 1
p Date.new(2001, 2, 3) <=> Object.new # => nil
p Date.new(2001, 2, 3) <=> Rational(4903887, 2) # => 0
//}
@pa......ram other 日付オブジェクトまたは数値... -
BigDecimal
# <=>(other) -> -1 | 0 | 1 | nil (24317.0) -
self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。
...self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には
-1 をそれぞれ返します。
self と other が比較できない場合には nil を返します。... -
RDoc
:: Context # <=>(other) -> -1 | 0 | 1 (24301.0) -
自身と other の full_name を比較した結果を返します。
...自身と other の full_name を比較した結果を返します。
ソートのために使われます。
@param other 自身と比較したいオブジェクトを指定します。... -
IPAddr
# <=>(other) -> Integer | nil (21400.0) -
self と other を比較します。
...self と other を比較します。
@param other 比較対象の IPAddr オブジェクト。
@return self と other のアドレスファミリが一致しない場合は nil を返します。
アドレスファミリが一致する場合は、両方の数値表現を Integer#<=>......で比較した結果を返します。
@see Integer#<=>... -
Range
# include?(obj) -> bool (12312.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...ている時に true を返します。
そうでない場合は、false を返します。
<=> メソッドによる演算により範囲内かどうかを判定するには Range#cover? を使用してください。
始端・終端・引数が数値であれば、 Range#cover? と同様の動......指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range#cover?, Range#===... -
Fiddle
:: Importer # bind(signature , *opts) { . . . } -> Fiddle :: Function (9324.0) -
Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。
...た、Fiddle::Importer#[] で Fiddle::Function オブジェクトとして
取り出すことができます。
signature で関数の名前とシネグチャを指定します。例えば
"int compare(void*, void*)" のように指定します。
opts には :stdcall もしくは :cdecl を渡......Fiddle::Importer
dlload "libc.so.6"
typealias "size_t", "unsigned long"
extern "int qsort(void*, size_t, size_t, void*)"
bind("int compare(void*, void*)"){|px, py|
x = px.to_s(Fiddle::SIZEOF_INT).unpack("i!")
y = py.to_s(Fiddle::SIZEOF_INT).unpack("i!")
x <=>......y
}
end
data = [32, 180001, -13, -1, 0, 49].pack("i!*")
M.qsort(Fiddle::Pointer[data], 6, Fiddle::SIZEOF_INT, M["compare"])
p data.unpack("i!*") # => [-13, -1, 0, 32, 49, 180001]... -
Range
# include?(obj) -> bool (9312.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...内に含まれている時に true を返します。
そうでない場合は、false を返します。
Range#=== は主に case 式での比較に用いられます。
<=> メソッドによる演算により範囲内かどうかを判定するには Range#cover? を使用してください。......Range#cover? と同様の動きをします。
@param obj 比較対象のオブジェクトを指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p......(1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range#cover?... -
Range
# member?(obj) -> bool (9212.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...ている時に true を返します。
そうでない場合は、false を返します。
<=> メソッドによる演算により範囲内かどうかを判定するには Range#cover? を使用してください。
始端・終端・引数が数値であれば、 Range#cover? と同様の動......指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range#cover?, Range#===...