29件ヒット
[1-29件を表示]
(0.015秒)
種類
- インスタンスメソッド (18)
- 文書 (6)
- クラス (5)
ライブラリ
- ビルトイン (23)
クラス
-
Enumerator
:: Lazy (18)
キーワード
- Lazy (5)
-
NEWS for Ruby 2
. 6 . 0 (6) -
find
_ all (6)
検索結果
先頭5件
-
Enumerator
:: Lazy # filter {|item| . . . } -> Enumerator :: Lazy (21273.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:......step>>:find_all>
1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerable#select... -
Enumerator
:: Lazy # select {|item| . . . } -> Enumerator :: Lazy (21273.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:......step>>:find_all>
1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerable#select... -
Enumerator
:: Lazy # find _ all {|item| . . . } -> Enumerator :: Lazy (6173.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:......step>>:find_all>
1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerable#select... -
Enumerator
:: Lazy (6088.0) -
map や select などのメソッドの遅延評価版を提供するためのクラス。
...map や select などのメソッドの遅延評価版を提供するためのクラス。
動作は通常の Enumerator と同じですが、以下のメソッドが遅延評価を行う
(つまり、配列ではなく Enumerator を返す) ように再定義されています。
* map/collect......t
* filter_map
* select/find_all
* reject
* grep, grep_v
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk, chunk_while
* uniq
* zip (※互換性のため、ブロックを渡さないケースのみlazy)
Lazyオブジェクトは、Enumerable#lazyメ......によって生成されます。
Lazyから値を取り出すには、Enumerator::Lazy#force または
Enumerable#first を呼びます。
//emlist[例][ruby]{
# 二乗して偶数になるような整数を、小さい方から5個表示する
p 1.step.lazy.select{|n| (n**2).even?}.first(5)
# LT....../collect_concat
* filter_map
* select/find_all
* reject
* grep, grep_v
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk, chunk_while
* uniq
* compact
* zip (※互換性のため、ブロックを渡さないケースのみlazy)
Lazyオブジェクト... -
NEWS for Ruby 2
. 6 . 0 (114.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...いキーと値に変換できるようになりました。 15143
* 別名
* Array#filter が Array#select の別名として追加されました。 13784
* Array#filter! が Array#select! の別名として追加されました。 13784
* Binding
* 新規メソッド......取りキーと値のペアを新しいキーと値に変換できるようになりました。 15143
* 別名
* Enumerable#filter が Enumerable#select の別名として追加されました。 13784
* Enumerator::ArithmeticSequence
* 等差数列(隣接する項が共通の差(......新しいクラスです。
Enumerable#chain や Enumerator#+ で生成されます。
* Enumerator::Lazy
* 別名
* Enumerator::Lazy#filter が Enumerator::Lazy#select の別名として追加されました。 13784
* Enumerator
* 新規メソッド
* Enumerator#+...