るりまサーチ

最速Rubyリファレンスマニュアル検索!
947件ヒット [1-100件を表示] (0.087秒)
トップページ > クエリ:c[x] > クエリ:<=>[x]

別のキーワード

  1. _builtin to_c
  2. etc sc_2_c_dev
  3. etc sc_2_c_bind
  4. tracer display_c_call
  5. tracer display_c_call=

検索結果

<< 1 2 3 ... > >>

Complex#<=>(other) -> -1 | 0 | 1 | nil (21146.0)

self の虚部がゼロで other が実数の場合、 self の実部の <=> メソッドで other と比較した結果を返します。 other が Complex で虚部がゼロの場合も同様です。

... <=> メソッドで other と比較した結果を返します。
other が Complex で虚部がゼロの場合も同様です。

その他の場合は nil を返します。

@param other 自身と比較する数値

//emlist[例][ruby]{
C
omplex(2, 3) <=> Complex(2, 3) #=> nil
C
omplex(2, 3) <=>...
...1 #=> nil
C
omplex(2) <=> 1 #=> 1
C
omplex(2) <=> 2 #=> 0
C
omplex(2) <=> 3 #=> -1
//}...

Numeric#<=>(other) -> -1 | 0 | 1 | nil (21124.0)

自身が other より大きい場合に 1 を、等しい場合に 0 を、小さい場合には -1 をそれぞれ返します。 自身と other が比較できない場合には nil を返します。

...す。

Numeric のサブクラスは、上の動作を満たすよう このメソッドを適切に再定義しなければなりません。

@param other 自身と比較したい数値を指定します。

//emlist[例][ruby]{
1 <=> 0 #=> 1
1 <=> 1 #=> 0
1 <=> 2 #=> -1
1 <=> "0" #=> nil
/...

Object#<=>(other) -> 0 | nil (21112.0)

self === other である場合に 0 を返します。そうでない場合には nil を返します。

...self === other である場合に 0 を返します。そうでない場合には nil を返します。

//emlist[例][ruby]{
a = Object.new
b = Object.new
a <=> a # => 0
a <=> b # => nil
//}

@see Object#===...

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

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

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

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

Gem::Dependency#<=>(other) -> Integer (21100.0)

self と other を Gem::Dependency#name の ASCII コードで比較して self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。

...self と other を Gem::Dependency#name の ASCII コードで比較して
self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。...

絞り込み条件を変える

RDoc::Context#<=>(other) -> -1 | 0 | 1 (21100.0)

自身と other の full_name を比較した結果を返します。

自身と other の full_name を比較した結果を返します。

ソートのために使われます。

@param other 自身と比較したいオブジェクトを指定します。

REXML::Comment#<=>(other) -> -1 | 0 | 1 (21100.0)

other と内容(REXML::Comment#string)を比較します。

...other と内容(REXML::Comment#string)を比較します。...

WEBrick::HTTPVersion#<=>(other) -> -1 | 0 | 1 | nil (21100.0)

自身と指定された other のバージョンを比較します。 自身が other より新しいなら 1、同じなら 0、古いなら -1 を返します。 比較できない場合に nil を返します。

...を返します。
比較できない場合に nil を返します。

@param other HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトか文字列を指定します。

require 'webrick'
v = WEBrick::HTTPVersion.new('1.1')
p v < '1.0' #=> false...

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

self と other を比較して、self が小さい時に -1、 等しい時に 0、大きい時に 1 の整数を返します。 また、other が 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 比較対...
<< 1 2 3 ... > >>