るりまサーチ

最速Rubyリファレンスマニュアル検索!
378件ヒット [201-300件を表示] (0.040秒)
トップページ > クラス:Enumerator::Lazy[x] > 種類:インスタンスメソッド[x]

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 > >>

Enumerator::Lazy#reject {|item| ... } -> Enumerator::Lazy (2.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.ste...

Enumerator::Lazy#select {|item| ... } -> Enumerator::Lazy (2.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...

Enumerator::Lazy#slice_after {|elt| bool } -> Enumerator::Lazy (2.0)

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

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

//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.tak...

Enumerator::Lazy#slice_after(pattern) -> Enumerator::Lazy (2.0)

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

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

//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.tak...

Enumerator::Lazy#slice_before {|elt| bool } -> Enumerator::Lazy (2.0)

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

...Enumerable#slice_before と同じですが、配列ではなく 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 }.t...

絞り込み条件を変える

Enumerator::Lazy#slice_before(initial_state) {|elt, state| bool } -> Enumerator::Lazy (2.0)

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

...Enumerable#slice_before と同じですが、配列ではなく 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 }.t...

Enumerator::Lazy#slice_before(pattern) -> Enumerator::Lazy (2.0)

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

...Enumerable#slice_before と同じですが、配列ではなく 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 }.t...

Enumerator::Lazy#slice_when {|elt_before, elt_after| bool } -> Enumerator::Lazy (2.0)

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

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

//emlist[例][ruby]{
1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007fce84118348>:each>>

1.step.lazy.slice_when { |i, j| (i +...

Enumerator::Lazy#take(n) -> Enumerator::Lazy (2.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#take_while -> Enumerator::Lazy (2.0)

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

...ble#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":cy...

絞り込み条件を変える

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

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

...ble#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":cy...
<< < 1 2 3 4 > >>