るりまサーチ

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

別のキーワード

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

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

...す。

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

|
は再定義可能な演算子に分類されていますので、通常は 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.|(true) #=> true
p false.|(false) #=> false
p false.|(nil) #=> false
p false.|(1 == 1) #=> true
p false.|(1 + 1) #=> true
//}...

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

常に true を返します。

...ます。

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

|
は再定義可能な演算子に分類されていますので、通常は 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
//}...

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

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

...は self における要素の順と同じです。

@
param other 配列を指定します。
配列以外のオブジェクトを指定した場合は to_ary メソッドによ
る暗黙の型変換を試みます。

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

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

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

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

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

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

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

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

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

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

...は self における要素の順と同じです。

@
param other 配列を指定します。
配列以外のオブジェクトを指定した場合は to_ary メソッドによ
る暗黙の型変換を試みます。

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

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

@
see Array#&...

絞り込み条件を変える

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

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

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

@
param other 数値

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

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

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

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

@
param other 数値

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

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

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

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

@
param other 数値

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

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

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

...t == frozen_text # => true
original_text.equal?(frozen_text) # => false

original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => true
//}

@
see String#+@...

String#+@ -> String | self (14210.0)

self が freeze されている文字列の場合、元の文字列の複製を返します。 freeze されていない場合は self を返します。

..._text # => true
original_text.equal?(unfrozen_text) # => true

original_text = "text".freeze
unfrozen_text = +original_text
unfrozen_text.frozen? # => false
original_text == unfrozen_text # => true
original_text.equal?(unfrozen_text) # => false
//}

@
see String#-@...

絞り込み条件を変える

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

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

...t == frozen_text # => true
original_text.equal?(frozen_text) # => false

original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => true
//}

@
see String#+@...

String#dedup -> String | self (11111.0)

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

...t == frozen_text # => true
original_text.equal?(frozen_text) # => false

original_text = "text".freeze
frozen_text = -original_text
frozen_text.frozen? # => true
original_text == frozen_text # => true
original_text.equal?(frozen_text) # => true
//}

@
see String#+@...

Integer#<=>(other) -> -1 | 0 | 1 | nil (8318.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 <=> '' # =>...

Rational#<=>(other) -> -1 | 0 | 1 | nil (8318.0)

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

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

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

@
return -1 か 0 か 1 か nil を返します。

//emlist[例][ruby]{
Rational(2, 3) <=> Rational(2, 3) # => 0
Rational...
<< 1 2 3 ... > >>