Class | Enumerator::Lazy |
In: |
lib/core/facets/enumerator/lazy/squeeze.rb
|
Parent: | Object |
Enumerator::Lazy version of Enumerable#squeeze. Note: you must use Ruby 2.0+ or require ‘backports’. For now, you have to require ‘facets/enumerator/lazy/squeeze’ explicitly.
Examples
[1,2,2,3,3,2,1].lazy.squeeze.to_a #=> [1,2,3,2,1] [1,2,2,3,3,2,1].lazy.squeeze(*[3]).to_a #=> [1,2,2,3,2,1]
Returns Enumerator::Lazy.
CREDIT: T. Yamada