別のキーワード
ライブラリ
- ビルトイン (288)
- bigdecimal (11)
- date (11)
- ipaddr (11)
- openssl (44)
- pathname (11)
-
rexml
/ document (22) -
rubygems
/ version (11) -
shell
/ filter (6) -
webrick
/ httpversion (11)
クラス
- Array (31)
- BigDecimal (11)
- Bignum (3)
- Complex (5)
- Date (11)
-
File
:: Stat (11) - Float (11)
-
Gem
:: Version (11) - IPAddr (11)
- Integer (11)
- Module (22)
- Numeric (95)
- Object (11)
-
OpenSSL
:: BN (22) -
OpenSSL
:: X509 :: Name (22) - Pathname (11)
-
REXML
:: Comment (11) -
REXML
:: Text (11) - Range (11)
- Rational (11)
-
Shell
:: Filter (6) - String (11)
- Symbol (11)
- Time (11)
-
WEBrick
:: HTTPVersion (11)
モジュール
- Enumerable (33)
キーワード
- <=> (239)
- bsearch (22)
-
bsearch
_ index (9) -
chunk
_ while (11) - cmp (22)
-
slice
_ before (22) - step (84)
検索結果
先頭5件
-
Module
# <=(other) -> bool | nil (21537.0) -
比較演算子。self が other の子孫であるか、self と other が 同一クラスである場合、 true を返します。 self が other の先祖である場合、false を返します。
...比較演算子。self が other の子孫であるか、self と other が
同一クラスである場合、 true を返します。
self が other の先祖である場合、false を返します。
継承関係にないクラス同士の比較では
nil を返します。
@param other 比較......Module#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo <= Bar # => false
Bar <= Foo # => true
Baz.ancestors # => [Foo, Baz]
Foo <= Baz # => false
Baz <= Foo # => true
Foo <= Foo # => true
Foo <= Object # => nil
//... -
Shell
:: Filter # |(filter) -> object (21330.0) -
パイプ結合を filter に対して行います。
...合を filter に対して行います。
@param filter Shell::Filter オブジェクトを指定します。
@return filter を返します。
使用例
require 'shell'
Shell.def_system_command("tail")
Shell.def_system_command("head")
Shell.def_system_command("wc")
sh = Shell.new
sh.......transact {
i = 1
while i <= (cat("/etc/passwd") | wc("-l")).to_s.chomp.to_i
puts (cat("/etc/passwd") | head("-n #{i}") | tail("-n 1")).to_s
i += 1
end
}... -
BigDecimal
# <=>(other) -> -1 | 0 | 1 | nil (15603.0) -
self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。
...self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には
-1 をそれぞれ返します。
self と other が比較できない場合には nil を返します。... -
Complex
# <=>(other) -> -1 | 0 | 1 | nil (15603.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
//}... -
Float
# <=>(other) -> -1 | 0 | 1 | nil (15603.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
//}... -
Rational
# <=>(other) -> -1 | 0 | 1 | nil (15603.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
//}... -
Symbol
# <=>(other) -> -1 | 0 | 1 | nil (15603.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... -
OpenSSL
:: BN # <=>(other) -> -1 | 0 | 1 (15404.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 比較する整数
@r......aise TypeError 比較できないときに発生します。
@see OpenSSL::BN#ucmp... -
OpenSSL
:: X509 :: Name # <=>(other) -> -1 | 0 | 1 (15404.0) -
他の OpenSSL::X509::Name オブジェクトと比較します。
...他の OpenSSL::X509::Name オブジェクトと比較します。
自身が other と一致する場合は 0、otherより大きい場合は1、
小さい場合は -1 を返します。
@param other 比較するオブジェクト... -
REXML
:: Comment # <=>(other) -> -1 | 0 | 1 (15402.0) -
other と内容(REXML::Comment#string)を比較します。
...other と内容(REXML::Comment#string)を比較します。... -
REXML
:: Text # <=>(other) -> -1 | 0 | 1 (15402.0) -
テキストの内容を other と比較します。
...テキストの内容を other と比較します。
@param other 比較対象(REXML::Text オブジェクトもしくは文字列)...