るりまサーチ

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

別のキーワード

  1. csv force_quotes?
  2. lazy force
  3. _builtin force
  4. options force_output
  5. options force_update

ライブラリ

キーワード

検索結果

<< 1 2 3 > >>

Enumerator::Lazy#force(*args) -> [object] (18109.0)

全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。

...要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。

Enumerable#to_a のエイリアスです。

//emlist[例][ruby]{
1.step.lazy.take(10).force
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

1.step.lazy.take(10).to_a
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
//}...

Enumerator::Lazy#collect_concat {|item| ... } -> Enumerator::Lazy (20.0)

ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。

...行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy
のインスタンスを返します。

//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}

ブロックの返した値 x は、以下...
...を持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき

それ以外のときは、x は分解されず、そのままの値として使われます。

//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}

@raise Argume...

Enumerator::Lazy#flat_map {|item| ... } -> Enumerator::Lazy (20.0)

ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。

...行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy
のインスタンスを返します。

//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}

ブロックの返した値 x は、以下...
...を持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき

それ以外のときは、x は分解されず、そのままの値として使われます。

//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}

@raise Argume...

Enumerator::Lazy#chunk {|elt| ... } -> Enumerator::Lazy (8.0)

Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。

...じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>

1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]...

Enumerator::Lazy#chunk(initial_state) {|elt, state| ... } -> Enumerator::Lazy (8.0)

Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。

...じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>

1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]...

絞り込み条件を変える

Enumerator::Lazy#collect {|item| ... } -> Enumerator::Lazy (8.0)

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

...Enumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n| n.succ }.take(10).force...

Enumerator::Lazy#drop(n) -> Enumerator::Lazy (8.0)

Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。

...ですが、配列ではなくEnumerator::Lazy を返します。

@param n 要素数を指定します。

@raise ArgumentError n に負の数を指定した場合に発生します。

//emlist[例][ruby]{
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop...
...(3)>

1.step.lazy.drop(3).take(10).force
# => [4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
//}

@see Enumerable#drop...

Enumerator::Lazy#drop_while {|item| ... } -> Enumerator::Lazy (8.0)

Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。

...同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>

1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42, 43, 44, 45, 46, 47, 48,...

Enumerator::Lazy#filter {|item| ... } -> Enumerator::Lazy (8.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

...同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.st...
...ep.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...

Enumerator::Lazy#filter_map {|item| ... } -> Enumerator::Lazy (8.0)

Enumerable#filter_map と同じですが、配列ではなく Enumerator::Lazy を返します。

...ですが、配列ではなく Enumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.filter_map { |n| n * 2 if n.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: (1.step)>:filter_map>

1.step.la...
...zy.filter_map { |n| n * 2 if n.even? }.take(10).force
# => [4, 8, 12, 16, 20, 24, 28, 32, 36, 40]
//}

@see Enumerable#filter_map...

絞り込み条件を変える

Enumerator::Lazy#find_all {|item| ... } -> Enumerator::Lazy (8.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

...同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.st...
...ep.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...
<< 1 2 3 > >>