るりまサーチ

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

別のキーワード

  1. _builtin select
  2. _builtin select!
  3. dbm select
  4. struct select
  5. set select!

検索結果

Enumerator::Lazy#eager -> Enumerator (18135.0)

自身を遅延評価しない Enumerator に変換して返します。

...ch.lazy

# select が遅延評価されるので終了する
p lazy_enum.class # => Enumerator::Lazy
p lazy_enum.select { |n| n.even? }.first(5)
# => [2, 4, 6, 8, 10]

# select が遅延評価されないので終了しない
enum = lazy_enum.eager
p enum.class # => Enumerator
p enum.select { |n| n....