種類
- インスタンスメソッド (576)
- モジュール関数 (100)
- 特異メソッド (22)
- ライブラリ (11)
ライブラリ
- ビルトイン (493)
- bigdecimal (22)
- cmath (12)
- date (11)
- fiddle (11)
- ipaddr (11)
- openssl (44)
- pathname (11)
- rake (11)
-
rexml
/ document (22) -
rubygems
/ version (11) -
shell
/ filter (6) - tracer (22)
-
webrick
/ httpversion (11)
クラス
- Array (31)
- BigDecimal (22)
- Bignum (3)
- Complex (16)
- Date (11)
-
Fiddle
:: Pointer (11) -
File
:: Stat (11) - Fixnum (3)
- Float (44)
-
Gem
:: Version (11) - Hash (9)
- IPAddr (11)
- Integer (22)
- Module (22)
- Numeric (106)
- Object (11)
-
OpenSSL
:: BN (22) -
OpenSSL
:: X509 :: Name (22) - Pathname (11)
-
REXML
:: Comment (11) -
REXML
:: Text (11) -
Rake
:: EarlyTime (11) - Range (28)
- Rational (11)
-
Shell
:: Filter (6) - String (11)
- Symbol (11)
- Time (11)
- Tracer (22)
-
WEBrick
:: HTTPVersion (11)
モジュール
- CMath (12)
- Comparable (22)
- Enumerable (33)
- Kernel (66)
- Math (22)
検索結果
先頭5件
-
Module
# <=(other) -> bool | nil (21336.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
//... -
Comparable
# <=(other) -> bool (21218.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が負の整数か 0 を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。
...比較演算子 <=> をもとにオブジェクト同士を比較します。
<=> が負の整数か 0 を返した場合に、true を返します。
それ以外の整数を返した場合に、false を返します。
@param other 自身と比較したいオブジェクトを指定します。......@raise ArgumentError <=> が nil を返したときに発生します。
//emlist[例][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}... -
Float
# <=(other) -> bool (21206.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
3.14 < 3.1415 # => true
3.14 <= 3.1415 # => true
//}... -
BigDecimal
# <=(other) -> bool (21200.0) -
self が other より小さいか等しい場合に true を、そうでない場合に false を返します。
...self が other より小さいか等しい場合に true を、そうでない場合に false
を返します。... -
Complex
# <=(other) -> bool (21200.0) -
@undef
@undef -
Hash
# <=(other) -> bool (18218.0) -
self が other のサブセットか同じである場合に真を返します。
...self が other のサブセットか同じである場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 <= h2 # => true
h2 <= h1 # => false
h1 <= h1 # => true
//}
@see... -
Integer
# <=(other) -> bool (18218.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}... -
Fixnum
# <=(other) -> bool (18200.0) -
比較演算子。数値として等しいまたは小さいか判定します。
...演算子。数値として等しいまたは小さいか判定します。
@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。... -
BigDecimal
# <=>(other) -> -1 | 0 | 1 | nil (9200.0) -
self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。
...self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には
-1 をそれぞれ返します。
self と other が比較できない場合には nil を返します。... -
Complex
# <=>(other) -> -1 | 0 | 1 | nil (9200.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
//}... -
File
:: Stat # <=>(o) -> Integer | nil (9200.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
//}...