Sha256: 165d845af5261890ffffb730f130e7bf1b79fae769e4cd5cd0f80a14ea3108ce

Contents?: true

Size: 297 Bytes

Versions: 8

Compression:

Stored size: 297 Bytes

Contents

module Stages
  class Feeder < Stage
    def initialize
      @values = []
      super()
    end

    def <<(value)
      @values.push(value)
      reset if done?
    end

    def process
      loop do
        break if @values.empty?
        handle_value @values.shift
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
stages-1.2.1 lib/stages/feeder.rb
stages-1.2.0 lib/stages/feeder.rb
stages-1.1.5 lib/stages/feeder.rb
stages-1.1.2 lib/stages/feeder.rb
stages-1.1.1 lib/stages/feeder.rb
stages-1.0.1 lib/stages/feeder.rb
stages-1.0.0 lib/stages/feeder.rb
stages-0.4.1 lib/stages/feeder.rb