ライブラリ
- ビルトイン (378)
キーワード
- chunk (22)
-
chunk
_ while (8) - collect (11)
-
collect
_ concat (11) - compact (3)
- drop (11)
-
drop
_ while (11) - eager (5)
-
enum
_ for (22) - filter (6)
-
filter
_ map (5) -
find
_ all (11) -
flat
_ map (11) - force (11)
- grep (11)
-
grep
_ v (9) - map (11)
- reject (11)
- select (11)
-
slice
_ after (20) -
slice
_ before (33) -
slice
_ when (10) - take (11)
-
take
_ while (22) -
to
_ enum (22) - uniq (16)
-
with
_ index (10) - zip (22)
検索結果
先頭5件
- Enumerator
:: Lazy # slice _ after(pattern) -> Enumerator :: Lazy - Enumerator
:: Lazy # slice _ when {|elt _ before , elt _ after| bool } -> Enumerator :: Lazy - Enumerator
:: Lazy # uniq -> Enumerator :: Lazy - Enumerator
:: Lazy # uniq {|item| . . . } -> Enumerator :: Lazy - Enumerator
:: Lazy # chunk _ while {|elt _ before , elt _ after| . . . } -> Enumerator :: Lazy
-
Enumerator
:: Lazy # slice _ after(pattern) -> Enumerator :: Lazy (11138.0) -
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
...ice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>
1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).force
# =... -
Enumerator
:: Lazy # slice _ when {|elt _ before , elt _ after| bool } -> Enumerator :: Lazy (11137.0) -
Enumerable#slice_when と同じですが、配列ではなく Enumerator::Lazy を返します。
...when と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007fce84118348>:each>>
1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }.take... -
Enumerator
:: Lazy # uniq -> Enumerator :: Lazy (11120.0) -
Enumerable#uniq と同じですが、配列ではなく Enumerator::Lazy を返します。
...Enumerable#uniq と同じですが、配列ではなく Enumerator::Lazy を返します。... -
Enumerator
:: Lazy # uniq {|item| . . . } -> Enumerator :: Lazy (11120.0) -
Enumerable#uniq と同じですが、配列ではなく Enumerator::Lazy を返します。
...Enumerable#uniq と同じですが、配列ではなく Enumerator::Lazy を返します。... -
Enumerator
:: Lazy # chunk _ while {|elt _ before , elt _ after| . . . } -> Enumerator :: Lazy (11119.0) -
Enumerable#chunk_while と同じですが、Enumerator ではなく Enumerator::Lazy を返します。
...Enumerable#chunk_while と同じですが、Enumerator ではなく Enumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。... -
Enumerator
:: Lazy # compact -> Enumerator :: Lazy (11119.0) -
Enumerable#compact と同じですが、配列ではなく Enumerator::Lazy を返します。
...Enumerable#compact と同じですが、配列ではなく Enumerator::Lazy を返します。... -
Enumerator
:: Lazy # with _ index(offset = 0) -> Enumerator :: Lazy (11110.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...クスは offset から始まります。
ブロックを指定した場合の戻り値は生成時に指定したレシーバ自身です。
//emlist[][ruby]{
("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force
# => 1:a
# 2:b
# 3:c
//}
@see Enumerator#with_index... -
Enumerator
:: Lazy # with _ index(offset = 0) {|(*args) , idx| . . . } -> Enumerator :: Lazy (11110.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...クスは offset から始まります。
ブロックを指定した場合の戻り値は生成時に指定したレシーバ自身です。
//emlist[][ruby]{
("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force
# => 1:a
# 2:b
# 3:c
//}
@see Enumerator#with_index... -
Enumerator
:: Lazy # zip(*lists) {|v1 , v2 , . . . | . . . } -> nil (11043.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...配列ではなくEnumerator::Lazy を返します。
ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:st......ep>>:zip(#<Enumerator: "a".."z":cycle>)>
1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}
@see Enumerable#zip... -
Enumerator
:: Lazy # eager -> Enumerator (11038.0) -
自身を遅延評価しない Enumerator に変換して返します。
...//emlist[例][ruby]{
lazy_enum = (1..).each.lazy
# select が遅延評価されるので終了する
p lazy_enum.class # => Enumerator::Lazy
p lazy_enum.select { |n| n.even? }.first(5)
# => [2, 4, 6, 8, 10]
# select が遅延評価されないので終了しない
enum = lazy_enum.eager
p enum.cl... -
Enumerator
:: Lazy # force(*args) -> [object] (11030.0) -
全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。
...全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。
Enumerable#to_a のエイリアスです。
//emlist[例][ruby]{
1.step.lazy.take(10).force
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1.step.lazy.take(10).to_a
# => [1, 2, 3, 4, 5, 6, 7, 8, 9,...