るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. _builtin lazy
  2. lazy slice_before
  3. lazy zip
  4. lazy chunk
  5. lazy to_enum

クラス

モジュール

検索結果

Enumerable#lazy -> Enumerator::Lazy (73513.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#grep(pattern) {|item| ... } -> Enumerator::Lazy (73384.0)

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

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

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)....

Enumerator::Lazy (72331.0)

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

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

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

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

Enumerator::Lazy#grep_v(pattern) {|item| ... } -> Enumerator::Lazy (37384.0)

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

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

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/).t...