るりまサーチ

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

別のキーワード

  1. socket int
  2. prime int_from_prime_division
  3. _builtin to_int
  4. mkmf convertible_int
  5. option int

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Integer#<(other) -> bool (21113.0)

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

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

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

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

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

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

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

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

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

Integer#<<(bits) -> Integer (9201.0)

シフト演算子。bits だけビットを左にシフトします。

...シフト演算子。bits だけビットを左にシフトします。

@param bits シフトさせるビット数

//emlist[][ruby]{
printf("%#b\n", 0b0101 << 1) # => 0b1010
p -1 << 1 # => -2
//}...

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

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

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

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

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

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

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

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

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

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

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

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

self と other を比較します。

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

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

@see Integer#<=>...

Logger#<<(msg) -> Integer | nil (6201.0)

ログを出力します。

...ログを出力します。

@param msg ログに出力するメッセージ。

//emlist[例][ruby]{
require 'logger'
logger = Logger.new(STDOUT)

logger << "add message"

# => add message
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>