るりまサーチ

最速Rubyリファレンスマニュアル検索!
700件ヒット [1-100件を表示] (0.105秒)

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Integer#<=(other) -> bool (21118.0)

比較演算子。数値として等しいまたは小さいか判定します。

...other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 <= 0 # => false
1 <= 1 # => true
1 <= 2 # => true
//}...

BigDecimal#<=(other) -> bool (21100.0)

self が other より小さいか等しい場合に true を、そうでない場合に false を返します。

self が other より小さいか等しい場合に true を、そうでない場合に false
を返します。

Fixnum#<=(other) -> bool (21100.0)

比較演算子。数値として等しいまたは小さいか判定します。

比較演算子。数値として等しいまたは小さいか判定します。

@param other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。

Module#<=(other) -> bool | nil (18236.0)

比較演算子。self が other の子孫であるか、self と other が 同一クラスである場合、 true を返します。 self が other の先祖である場合、false を返します。

...ラス同士の比較では
nil を返します。

@param other 比較対象のモジュールやクラス

@raise TypeError other がクラスやモジュールではない場合に発生します。

@see Module#<

//emlist[例][ruby]{
module Foo; end
module Bar
i
nclude Foo
end
module Baz
pre...
...pend 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
//}...

BigDecimal#<=>(other) -> -1 | 0 | 1 | nil (9200.0)

self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。

...self が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には
-1 をそれぞれ返します。

self と other が比較できない場合には nil を返します。...

絞り込み条件を変える

Bignum#<=>(other) -> Fixnum | nil (9200.0)

self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。

...self と other を比較して、self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。

@param other 比較対象の数値
@return -1 か 0 か 1 のいずれか

1 <=> 2 #=> -1
1 <=> 1 #=> 0
2 <=> 1 #=> 1...

Fiddle::Pointer#<=>(other) -> Integer (9200.0)

ポインタの指すアドレスの大小を比較します。

...ポインタの指すアドレスの大小を比較します。

other より小さい場合は -1, 等しい場合は 0、other より大きい場合は
1を返します。

@param other 比較対象の Pointer オブジェクト...

File::Stat#<=>(o) -> Integer | nil (9200.0)

ファイルの最終更新時刻を比較します。self が other よりも 新しければ正の数を、等しければ 0 を古ければ負の数を返します。 比較できない場合は nil を返します。

...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::S...
...tat.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
//}...

Fixnum#<=>(other) -> Fixnum (9200.0)

self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。

...self と other を比較して、self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。

@param other 比較対象の数値
@return -1 か 0 か 1 のいずれか

1 <=> 2 #=> -1
1 <=> 1 #=> 0
2 <=> 1 #=> 1...

Gem::Version#<=>(other) -> -1 | 0 | 1 | nil (9200.0)

self と other を比較して、self が小さい時に -1、 等しい時に 0、大きい時に 1 の整数を返します。 また、other が Gem::Version ではなく比較できないとき、 nil を返します。

...ther が Gem::Version ではなく比較できないとき、 nil を返します。

//emlist[][ruby]{
p Gem::Version.new("3.9.0") <=> Gem::Version.new("3.10.0") # => -1
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0.0") # => 0
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0")...
...# => 0

p Gem::Version.new("3.9.0") <=> "3.9.0" # => nil
//}

@param other 比較対象の Gem::Version のインスタンスを指定します。...

絞り込み条件を変える

IPAddr#<=>(other) -> Integer | nil (9200.0)

self と other を比較します。

... IPAddr オブジェクト。

@return self と other のアドレスファミリが一致しない場合は nil を返します。
アドレスファミリが一致する場合は、両方の数値表現を Integer#<=>
で比較した結果を返します。

@see Integer#<=>...

Integer#<=>(other) -> -1 | 0 | 1 | nil (9200.0)

self と other を比較して、self が大きい時に1、等しい時に 0、小さい時 に-1、比較できない時に nil を返します。

...、self が大きい時に1、等しい時に 0、小さい時
に-1、比較できない時に nil を返します。

@param other 比較対象の数値
@return -1 か 0 か 1 か nil のいずれか

//emlist[][ruby]{
1 <=> 2 # => -1
1 <=> 1 # => 0
2 <=> 1 # => 1
2 <=> '' # => nil
//}...
<< 1 2 3 ... > >>