ライブラリ
- ビルトイン (291)
キーワード
- chunk (22)
- collect (11)
-
collect
_ concat (11) - drop (11)
-
drop
_ while (11) - filter (6)
-
filter
_ map (5) -
find
_ all (11) -
flat
_ map (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) -
with
_ index (10) - zip (22)
検索結果
先頭5件
- Enumerator
:: Lazy # force(*args) -> [object] - Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy - Enumerator
:: Lazy # flat _ map {|item| . . . } -> Enumerator :: Lazy - Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy - Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy
-
Enumerator
:: Lazy # force(*args) -> [object] (26109.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, 10]
//}... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (8020.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 が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}
@raise Argume... -
Enumerator
:: Lazy # flat _ map {|item| . . . } -> Enumerator :: Lazy (8020.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 が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}
@raise Argume... -
Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy (8008.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]... -
Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy (8008.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]... -
Enumerator
:: Lazy # collect {|item| . . . } -> Enumerator :: Lazy (8008.0) -
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
...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... -
Enumerator
:: Lazy # drop(n) -> Enumerator :: Lazy (8008.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(10).force
# => [4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
//}
@see Enumerable#drop... -
Enumerator
:: Lazy # drop _ while {|item| . . . } -> Enumerator :: Lazy (8008.0) -
Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...同じですが、配列ではなく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, 46, 47, 48,... -
Enumerator
:: Lazy # filter {|item| . . . } -> Enumerator :: Lazy (8008.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>
1.st......ep.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerable#select... -
Enumerator
:: Lazy # filter _ map {|item| . . . } -> Enumerator :: Lazy (8008.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.la......zy.filter_map { |n| n * 2 if n.even? }.take(10).force
# => [4, 8, 12, 16, 20, 24, 28, 32, 36, 40]
//}
@see Enumerable#filter_map... -
Enumerator
:: Lazy # find _ all {|item| . . . } -> Enumerator :: Lazy (8008.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>
1.st......ep.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerable#select...