るりまサーチ

最速Rubyリファレンスマニュアル検索!
967件ヒット [201-300件を表示] (0.020秒)

別のキーワード

  1. _builtin <=
  2. bigdecimal <=
  3. float <=
  4. module <=
  5. complex <=

クラス

モジュール

検索結果

<< < 1 2 3 4 5 ... > >>

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

self と other を比較します。

...の IPAddr オブジェクト。

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

@see Integer#<=>...

Integer#<=>(other) -> -1 | 0 | 1 | nil (6100.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
//}...

Module#<=>(other) -> Integer | nil (6100.0)

self と 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
//}...

Numeric#<=>(other) -> -1 | 0 | 1 | nil (6100.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 (6100.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#===...

絞り込み条件を変える

OpenSSL::BN#<=>(other) -> -1 | 0 | 1 (6100.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 比較する整数
@raise TypeErr...

OpenSSL::X509::Name#<=>(other) -> -1 | 0 | 1 (6100.0)

他の OpenSSL::X509::Name オブジェクトと比較します。

他の OpenSSL::X509::Name オブジェクトと比較します。

自身が other と一致する場合は 0、otherより大きい場合は1、
小さい場合は -1 を返します。

@param other 比較するオブジェクト

Pathname#<=>(other) -> -1 | 0 | 1 | nil (6100.0)

パス名を比較します。other と同じなら 0 を、ASCII順で self が大きい場合 は正、other が大きい場合は負を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。

...対象の Pathname オブジェクトを指定します。

//emlist[例][ruby]{
require 'pathname'

p Pathname.new("foo/bar") <=> Pathname.new("foo/bar")
p Pathname.new("foo/bar") <=> Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") <=> Pathname.new("foo/bar")
# => 0
# 1
# -1
//}...

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

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

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

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

@param other 自身と比較したいオブジェクトを指定します。
<< < 1 2 3 4 5 ... > >>