別のキーワード
クラス
-
Enumerator
:: Lazy (262) - Integer (72)
- Numeric (93)
- Range (45)
キーワード
- % (14)
- chunk (24)
- collect (12)
- downto (24)
- drop (12)
-
drop
_ while (12) - filter (7)
-
filter
_ map (6) -
find
_ all (12) - force (12)
- map (12)
- reject (12)
- select (12)
-
slice
_ after (22) -
slice
_ before (36) -
slice
_ when (11) - take (12)
-
take
_ while (24) - times (24)
- upto (24)
- zip (24)
検索結果
先頭5件
-
Enumerator
:: Lazy # map {|item| . . . } -> Enumerator :: Lazy (33.0) -
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
...umentError ブロックを指定しなかった場合に発生します。
//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, 9, 10, 11]
//}
@se... -
Enumerator
:: Lazy # reject {|item| . . . } -> Enumerator :: Lazy (33.0) -
Enumerable#reject と同じですが、配列ではなくEnumerator::Lazy を返します。
...entError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.reject { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:reject>
1.step.lazy.reject { |i| i.even? }.take(10).force
# => [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
//... -
Enumerator
:: Lazy # select {|item| . . . } -> Enumerator :: Lazy (33.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...tError ブロックを指定しなかった場合に発生します。
//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]... -
Enumerator
:: Lazy # take(n) -> Enumerator :: Lazy (33.0) -
Enumerable#take と同じですが、配列ではなくEnumerator::Lazy を返します。
...数を指定します。
@raise ArgumentError 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 # take _ while -> Enumerator :: Lazy (33.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...:Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>
1.step.lazy.zip(('a'..'z').cycle).take_while... -
Enumerator
:: Lazy # take _ while {|item| . . . } -> Enumerator :: Lazy (33.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...:Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>
1.step.lazy.zip(('a'..'z').cycle).take_while... -
Enumerator
:: Lazy # zip(*lists) -> Enumerator :: Lazy (33.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...合は Enumerable#zip と
同じ挙動になります。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>
1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"... -
Enumerator
:: Lazy # zip(*lists) {|v1 , v2 , . . . | . . . } -> nil (33.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...合は Enumerable#zip と
同じ挙動になります。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>
1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"... -
Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy (27.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
...すが、配列ではなく 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]], [true, [3]], [fa...