るりまサーチ

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

別のキーワード

  1. matrix find_index
  2. _builtin find_index
  3. find find
  4. pathname find
  5. _builtin find_all

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 >>

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

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

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

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

Enumerable#lazy -> Enumerator::Lazy (7.0)

自身を lazy な Enumerator に変換したものを返します。

...(つまり、配列ではな
くEnumeratorを返す) ように再定義されています。

* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cycl...
<< < 1 2 >>