ライブラリ
- ビルトイン (465)
クラス
-
Enumerator
:: Lazy (417)
モジュール
- Enumerable (36)
- GC (12)
キーワード
- chunk (24)
-
chunk
_ while (9) - collect (12)
-
collect
_ concat (12) - compact (4)
- drop (12)
-
drop
_ while (12) - eager (6)
-
enum
_ for (24) - filter (7)
-
filter
_ map (6) -
find
_ all (12) -
flat
_ map (12) - force (12)
-
garbage
_ collect (12) - grep (12)
-
grep
_ v (10) - map (12)
- reject (12)
- select (12)
-
slice
_ after (22) -
slice
_ before (36) -
slice
_ when (11) - sum (24)
- take (12)
-
take
_ while (24) -
to
_ enum (24) - uniq (18)
-
with
_ index (12) - zip (24)
検索結果
先頭5件
-
Enumerator
:: Lazy # drop(n) -> Enumerator :: Lazy (3142.0) -
Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerator::Lazy を返します。
@param n 要素数を指定します。
@raise ArgumentError n に負の数を指定した場合に発生します。
//emlist[例][ruby]{
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop(3)>
1.step.lazy.drop(3).take... -
Enumerator
:: Lazy # drop _ while {|item| . . . } -> Enumerator :: Lazy (3142.0) -
Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>
1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42, 43, 44, 45... -
Enumerator
:: Lazy # filter _ map {|item| . . . } -> Enumerator :: Lazy (3142.0) -
Enumerable#filter_map と同じですが、配列ではなく Enumerator::Lazy を返します。
...なく Enumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.filter_map { |n| n * 2 if n.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: (1.step)>:filter_map>
1.step.lazy.filter_map { |n| n *... -
Enumerator
:: Lazy # reject {|item| . . . } -> Enumerator :: Lazy (3142.0) -
Enumerable#reject と同じですが、配列ではなくEnumerator::Lazy を返します。
...はなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.reject { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:reject>
1.step.lazy.reject { |i| i.even? }.... -
Enumerator
:: Lazy # take(n) -> Enumerator :: Lazy (3142.0) -
Enumerable#take と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#take と同じですが、配列ではなくEnumerator::Lazy を返します。
n が大きな数 (100000とか) の場合に備えて再定義されています。
配列が必要な場合は Enumerable#first を使って下さい。
@param n 要素数を指定します。
@raise Arg......umentError n に負の数を指定した場合に発生します。
//emlist[例][ruby]{
1.step.lazy.take(5)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:take(5)>
1.step.lazy.take(5).force
# => [1, 2, 3, 4, 5]
//}
@see Enumerable#take... -
Enumerator
:: Lazy # zip(*lists) -> Enumerator :: Lazy (3142.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...ではなくEnumerator::Lazy を返します。
ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:z......ip(#<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 # slice _ before {|elt| bool } -> Enumerator :: Lazy (3138.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
...ore と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1... -
Enumerator
:: Lazy # slice _ before(initial _ state) {|elt , state| bool } -> Enumerator :: Lazy (3138.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
...ore と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1... -
Enumerator
:: Lazy # slice _ before(pattern) -> Enumerator :: Lazy (3138.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
...ore と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1... -
Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy (3137.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
...#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>
1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]...