4件ヒット
[1-4件を表示]
(0.031秒)
検索結果
先頭4件
-
Enumerable
# lazy -> Enumerator :: Lazy (81787.0) -
自身を lazy な Enumerator に変換したものを返します。
自身を lazy な Enumerator に変換したものを返します。
この Enumerator は、以下のメソッドが遅延評価を行う (つまり、配列ではな
くEnumeratorを返す) ように再定義されています。
* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡さないケースのみl... -
Enumerator
:: Lazy # take _ while -> Enumerator :: Lazy (63943.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>
1.step.lazy.... -
Enumerator
:: Lazy # take _ while {|item| . . . } -> Enumerator :: Lazy (63943.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>
1.step.lazy.... -
Enumerator
:: Lazy (54205.0) -
map や select などのメソッドの遅延評価版を提供するためのクラス。
map や select などのメソッドの遅延評価版を提供するためのクラス。
動作は通常の Enumerator と同じですが、以下のメソッドが遅延評価を行う
(つまり、配列ではなく Enumerator を返す) ように再定義されています。
* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk
* zip ...