るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
4件ヒット [1-4件を表示] (0.030秒)
トップページ > バージョン:2.6.0[x] > クエリ:lazy[x] > クエリ:take_while[x]

別のキーワード

  1. _builtin take_while
  2. _builtin take
  3. array take_while
  4. enumerable take_while

ライブラリ

クラス

モジュール

検索結果

Enumerator::Lazy#take_while -> Enumerator::Lazy (63871.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 (63871.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....

Enumerable#lazy -> Enumerator::Lazy (54781.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 (18163.0)

map や select などのメソッドの遅延評価版を提供するためのクラス。

map や select などのメソッドの遅延評価版を提供するためのクラス。

動作は通常の Enumerator と同じですが、以下のメソッドが遅延評価を行う
(つまり、配列ではなく Enumerator を返す) ように再定義されています。

* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep, grep_v
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk...