Class: Pacer::Pipes::EnumerablePipe
- Defined in:
- lib/pacer/pipe/enumerable_pipe.rb
Instance Attribute Summary
Attributes inherited from RubyPipe
Instance Method Summary collapse
-
#initialize(enumerable) ⇒ EnumerablePipe
constructor
A new instance of EnumerablePipe.
- #processNextStart ⇒ Object
Methods inherited from RubyPipe
#enablePath, #reset, #setStarts
Constructor Details
#initialize(enumerable) ⇒ EnumerablePipe
Returns a new instance of EnumerablePipe.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/pacer/pipe/enumerable_pipe.rb', line 3 def initialize(enumerable) super() case enumerable when Enumerator starts = enumerable when Pacer::Wrappers::ElementWrapper starts = [enumerable.element].to_enum when Enumerable starts = enumerable.to_enum else starts = [enumerable].to_enum end set_starts starts end |
Instance Method Details
#processNextStart ⇒ Object
18 19 20 21 22 |
# File 'lib/pacer/pipe/enumerable_pipe.rb', line 18 def processNextStart() @starts.next rescue StopIteration raise EmptyPipe.instance end |