るりまサーチ

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

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. inspect? irb::context#inspect_mode
  5. inspect? irb::context#inspect_mode=

ライブラリ

検索結果

Enumerator::Lazy#slice_when {|elt_before, elt_after| bool } -> Enumerator::Lazy (24.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 +...
...j) % 5 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5, 6, 7], [8, 9, 10, 11, 12], [13, 14, 15, 16, 17], [18, 19, 20, 21, 22]]
//}

@see Enumerable#slice_when...