るりまサーチ (Ruby 2.6.0)

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

Enumerable#lazy -> Enumerator::Lazy (97525.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#collect {|item| ... } -> Enumerator::Lazy (97174.0)

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

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

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

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8,...

Enumerator::Lazy (96325.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...

Enumerator::Lazy#collect_concat {|item| ... } -> Enumerator::Lazy (61156.0)

ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。

ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。

//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}

ブロックの返した値 x は、以下の場合にのみ分解され、連結されます。

* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) ...

Enumerator::Lazy#map {|item| ... } -> Enumerator::Lazy (51874.0)

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

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

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

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8,...

絞り込み条件を変える

Enumerator::Lazy#flat_map {|item| ... } -> Enumerator::Lazy (51856.0)

ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。

ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。

//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}

ブロックの返した値 x は、以下の場合にのみ分解され、連結されます。

* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) ...

GC#garbage_collect(full_mark: true, immediate_sweep: true) -> nil (42376.0)

ガーベージコレクトを開始します。

ガーベージコレクトを開始します。

GC.start や ObjectSpace.#garbage_collect と同じ働きをします。
GC.disable により GC が禁止されている場合でもガベージコレクトを開始します。

nil を返します。

@param full_mark マイナー GC を動作させる場合は false を、そうでない場
合は true を指定します。

@param immediate_sweep sweep を遅らせる(Lazy Sweep を行う)場合は false
を、そう...

ObjectSpace.#garbage_collect(full_mark: true, immediate_sweep: true) -> nil (42340.0)

どこからも参照されなくなったオブジェクトを回収します。 GC.start と同じです。

どこからも参照されなくなったオブジェクトを回収します。
GC.start と同じです。

@param full_mark マイナー GC を動作させる場合は false を、そうでない場
合は true を指定します。

@param immediate_sweep sweep を遅らせる(Lazy Sweep を行う)場合は false
を、そうでない場合は true を指定します。

注意: これらのキーワード引数は Ruby の実装やバージョンによって異なりま
す。将来のバージョンとの互換性も保証されませ...

GC.start(full_mark: true, immediate_sweep: true) -> nil (24073.0)

ガーベージコレクトを開始します。

ガーベージコレクトを開始します。

GC#garbage_collect や ObjectSpace.#garbage_collect と同じ働きをします。
GC.disable により GC が禁止されている場合でもガベージコレクトを開始します。

nil を返します。

@param full_mark マイナー GC を動作させる場合は false を、そうでない場
合は true を指定します。

@param immediate_sweep sweep を遅らせる(Lazy Sweep を行う)場合は false
...