Sha256: 821ace69683935b7b42eb2724f9dd5a34d9e34ddea0645b5b7ce72b323d4658e

Contents?: true

Size: 530 Bytes

Versions: 37

Compression:

Stored size: 530 Bytes

Contents

module Pacer::Pipes
  class EnumerablePipe < RubyPipe
    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

    def processNextStart()
      @starts.next
    rescue StopIteration
      raise EmptyPipe.instance
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
pacer-2.0.24-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.22-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.20-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.19-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.18-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.17-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.16-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.15-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.14-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.13-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.12-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.10-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.10.pre-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.8-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.6-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.4.pre-java lib/pacer/pipe/enumerable_pipe.rb
pacer-2.0.0.pre-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.6.0-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.5.4-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.5.3-java lib/pacer/pipe/enumerable_pipe.rb