るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Bignum#-(other) -> Fixnum | Bignum | Float (26305.0)

算術演算子。差を計算します。

算術演算子。差を計算します。

@param other 二項演算の右側の引数(対象)
@return 計算結果

Fixnum#-(other) -> Fixnum | Bignum | Float (26305.0)

算術演算子。差を計算します。

算術演算子。差を計算します。

@param other 二項演算の右側の引数(対象)
@return 計算結果

FalseClass#|(other) -> bool (26245.0)

other が真なら true を, 偽なら false を返します。

...

|
は再定義可能な演算子に分類されていますので、通常は false | other の形で使われます。

//emlist[例][ruby]{
p false | true #=> true
p false | false #=> false
p false | nil #=> false
p false | (1 == 1) #=> true
p false | (1 + 1) #=> true

p false.|(tru...
...e) #=> true
p false.|(false) #=> false
p false.|(nil) #=> false
p false.|(1 == 1) #=> true
p false.|(1 + 1) #=> true
//}...

TrueClass#|(other) -> bool (26245.0)

常に true を返します。

...

|
は再定義可能な演算子に分類されていますので、通常は true | other のように使われます。

//emlist[例][ruby]{
p true | true #=> true
p true | false #=> true
p true | nil #=> true
p true | (1 == 1) #=> true
p true | (1 + 1) #=> true

p true.|(true)...
...#=> true
p true.|(false) #=> true
p true.|(nil) #=> true
p true.|(1 == 1) #=> true
p true.|(1 + 1) #=> true
//}...

NilClass#|(other) -> bool (26227.0)

other が真なら true を, 偽なら false を返します。

...other が真なら true を, 偽なら false を返します。

@param other 論理和を行なう式です

//emlist[例][ruby]{
nil | true # => true
nil | false # => false
nil | nil # => false
nil | "a" # => true
//}...

絞り込み条件を変える

Bignum#|(other) -> Fixnum | Bignum (26216.0)

ビット二項演算子。論理和を計算します。

...ビット二項演算子。論理和を計算します。

@param other 数値

1 | 1 #=> 1
2 | 3 #=> 3...

Fixnum#|(other) -> Fixnum | Bignum (26216.0)

ビット二項演算子。論理和を計算します。

...ビット二項演算子。論理和を計算します。

@param other 数値

1 | 1 #=> 1
2 | 3 #=> 3...

Rational#-(other) -> Rational | Float (26216.0)

差を計算します。

...差を計算します。

@param other 自身から引く数

other に Float を指定した場合は、計算結果を Float で返しま
す。

//emlist[例][ruby]{
r = Rational(3, 4)
r - 1 # => (-1/4)
r - 0.5 # => 0.25
//}...

Integer#|(other) -> Integer (26215.0)

ビット二項演算子。論理和を計算します。

...ビット二項演算子。論理和を計算します。

@param other 数値

//emlist[][ruby]{
1 | 1 # => 1
2 | 3 # => 3
//}...

Array#|(other) -> Array (26209.0)

集合の和演算です。両方の配列にいずれかに含まれる要素を全て含む新し い配列を返します。重複する要素は取り除かれます。

...る暗黙の型変換を試みます。

@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
[1, 1, 4, 2, 3] | [5, 4, 5] #=> [1, 4, 2, 3, 5]
//}

@see Array#&...
...暗黙の型変換を試みます。

@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
[1, 1, 4, 2, 3] | [5, 4, 5] #=> [1, 4, 2, 3, 5]
//}

@see Array#&
@see Array#union...

絞り込み条件を変える

String#-@ -> String | self (14217.0)

self が freeze されている文字列の場合、self を返します。 freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。

...teral: false

original_text = "text"
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => false

original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen?...

String#dedup -> String | self (11217.0)

self が freeze されている文字列の場合、self を返します。 freeze されていない場合は元の文字列の freeze された (できる限り既存の) 複製を返します。

...teral: false

original_text = "text"
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => false

original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen?...

Time#<=>(other) -> -1 | 0 | 1 | nil (8483.0)

self と other の時刻を比較します。self の方が大きい場合は 1 を、等しい場合は 0 を、 小さい場合は -1 を返します。比較できない場合は、nil を返します。

...場合は -1 を返します。比較できない場合は、nil を返します。

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

//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 2592000 # => 2000-01-31 00:00:00...
...# => -1
p t2 <=> t # => 1
//}

//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 0.1 # => 2000-01-01 00:00:00 +0900
p t.nsec # => 0
p t2.nsec # => 100000000
p t <=> t2 # => -1
p t2 <=> t...
<< 1 2 3 ... > >>