るりまサーチ

最速Rubyリファレンスマニュアル検索!
378件ヒット [1-100件を表示] (0.156秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:l[x] > クラス:Enumerator::Lazy[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Enumerator::Lazy#lazy -> self (9102.0)

self を返します。

...self を返します。

//emlist[例][ruby]{
l
azy = (100..Float::INFINITY).lazy
p lazy.lazy # => #<Enumerator::Lazy: 100..Infinity>
p lazy == lazy.lazy # => true
//}...

Enumerator::Lazy#flat_map {|item| ... } -> Enumerator::Lazy (6202.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 ArgumentErro...
...r ブロックを指定しなかった場合に発生します。

@see Enumerable#flat_map...

Enumerator::Lazy#chunk_while {|elt_before, elt_after| ... } -> Enumerator::Lazy (6102.0)

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

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

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

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

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

...Enumerable#map と同じですが、配列ではなく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
# => [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
//}

@see Enumerable#map...

Enumerator::Lazy#collect_concat {|item| ... } -> Enumerator::Lazy (6102.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 ArgumentErro...
...r ブロックを指定しなかった場合に発生します。

@see Enumerable#flat_map...

絞り込み条件を変える

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

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

...Enumerable#drop_while と同じですが、配列ではなく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, 49, 50, 51]
//}

@see Enumerable#drop_while...

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

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

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

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

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

1.step.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 (6102.0)

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

...umerable#filter_map と同じですが、配列ではなく 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.lazy.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 (6102.0)

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

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

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

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

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

@see Enumerable#select...

Enumerator::Lazy#select {|item| ... } -> Enumerator::Lazy (6102.0)

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

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

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

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

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

@see Enumerable#select...

絞り込み条件を変える

Enumerator::Lazy#slice_after {|elt| bool } -> Enumerator::Lazy (6102.0)

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

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

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

1.step.lazy.slice_after { |e| e % 3 == 0 }.tak...
...e(5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

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