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-1.5.2-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.5.1-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.4.2-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.4.1-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.4.0-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.3.5-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.3.4-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.3.3-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.3.2-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.3.1-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.2.0-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.1.1-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.1.0-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.0.3-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.0.2-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.0.1-java lib/pacer/pipe/enumerable_pipe.rb
pacer-1.0.0-java lib/pacer/pipe/enumerable_pipe.rb