るりまサーチ

最速Rubyリファレンスマニュアル検索!
486件ヒット [201-300件を表示] (0.037秒)

別のキーワード

  1. _builtin step
  2. numeric step
  3. date step
  4. range step

キーワード

検索結果

<< < 1 2 3 4 5 > >>

Enumerator::Lazy#select {|item| ... } -> Enumerator::Lazy (20.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

...r ブロックを指定しなかった場合に発生します。

//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 (20.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 (20.0)

Enumerable#take_while と同じですが、配列ではなくEnumerator::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 { |e|...

Enumerator::Lazy#take_while {|item| ... } -> Enumerator::Lazy (20.0)

Enumerable#take_while と同じですが、配列ではなくEnumerator::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 { |e|...

Enumerator::Lazy#zip(*lists) -> Enumerator::Lazy (20.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 (20.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::ArithmeticSequence (14.0)

等差数列を提供するためのクラス。

...等差数列を提供するためのクラス。

ArithmeticSequenceオブジェクトは、Numeric#step, Range#step によって生成されます。...

Enumerator::Lazy#chunk {|elt| ... } -> Enumerator::Lazy (14.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]], [false...

Enumerator::Lazy#chunk(initial_state) {|elt, state| ... } -> Enumerator::Lazy (14.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]], [false...

Enumerator::Lazy#force(*args) -> [object] (14.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]
//}...

絞り込み条件を変える

<< < 1 2 3 4 5 > >>