![条件を削除 [x]](/images/drop-condition-icon.png)
種類
- インスタンスメソッド (255)
- 特異メソッド (8)
ライブラリ
- ビルトイン (263)
キーワード
- chunk (16)
-
chunk
_ while (5) - collect (8)
-
collect
_ concat (8) - drop (8)
-
drop
_ while (8) - eager (2)
-
enum
_ for (16) - filter (3)
-
find
_ all (8) -
flat
_ map (8) - force (8)
- grep (8)
-
grep
_ v (6) - lazy (8)
- map (8)
- new (8)
- reject (8)
- select (8)
-
slice
_ after (14) -
slice
_ before (24) -
slice
_ when (7) - take (8)
-
take
_ while (16) -
to
_ enum (16) - uniq (10)
- zip (16)
検索結果
先頭5件
- Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy - Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy - Enumerator
:: Lazy # chunk _ while {|elt _ before , elt _ after| . . . } -> Enumerator :: Lazy - Enumerator
:: Lazy # collect {|item| . . . } -> Enumerator :: Lazy - Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy
-
Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy (1.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
...Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
例:
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,... -
Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy (1.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
...Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
例:
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,... -
Enumerator
:: Lazy # chunk _ while {|elt _ before , elt _ after| . . . } -> Enumerator :: Lazy (1.0) -
Enumerable#chunk_while と同じですが、Enumerator ではなく Enumerator::Lazy を返します。
...Enumerable#chunk_while と同じですが、Enumerator ではなく Enumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。... -
Enumerator
:: Lazy # collect {|item| . . . } -> Enumerator :: Lazy (1.0) -
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
...le#map と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
例:
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>
1.step.lazy.... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (1.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
ブロックの返した値 x は、以下......されます。
* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
[{a:1}, {b:2}].lazy.flat_map {|i| i... -
Enumerator
:: Lazy # drop(n) -> Enumerator :: Lazy (1.0) -
Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。
...同じですが、配列ではなくEnumerator::Lazy を返します。
@param n 要素数を指定します。
@raise ArgumentError n に負の数を指定した場合に発生します。
例:
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop(3)>... -
Enumerator
:: Lazy # drop _ while {|item| . . . } -> Enumerator :: Lazy (1.0) -
Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
例:
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... -
Enumerator
:: Lazy # eager -> Enumerator (1.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... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy (1.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
例:
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise A... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (1.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
例:
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise A... -
Enumerator
:: Lazy # filter {|item| . . . } -> Enumerator :: Lazy (1.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...lect と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
例:
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>
1.step... -
Enumerator
:: Lazy # find _ all {|item| . . . } -> Enumerator :: Lazy (1.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
...lect と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
例:
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>
1.step... -
Enumerator
:: Lazy # flat _ map {|item| . . . } -> Enumerator :: Lazy (1.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
ブロックの返した値 x は、以下......されます。
* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
[{a:1}, {b:2}].lazy.flat_map {|i| i... -
Enumerator
:: Lazy # force(*args) -> [object] (1.0) -
全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。
全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。
Enumerable#to_a のエイリアスです。
例:
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 # grep(pattern) {|item| . . . } -> Enumerator :: Lazy (1.0) -
Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。
例:
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).lazy.ma......p(&:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
@see Enumerable#grep, Enumerable#grep_v, Enumerator::Lazy#grep_v...