Sha256: f7f9d65812f4377a984e12b3562f5d5a913f5cf20cffaa7a53a831589dd480a9

Contents?: true

Size: 416 Bytes

Versions: 15

Compression:

Stored size: 416 Bytes

Contents

module Stages
  class Restrict < Stage
    
    def initialize
      @open = true
      super()
    end
    
    def reset
      @open = true
      r = @last_value
      @last_value = nil
      r
    end
    
    def process
      while value = input
        while !@open
          handle_value nil
        end
        @open = false
        @last_value = value
        handle_value value
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
stages-0.3.4 lib/stages/restrict.rb
stages-0.3.3 lib/stages/restrict.rb
stages-0.3.2 lib/stages/restrict.rb
stages-0.3.1 lib/stages/restrict.rb
stages-0.3.0 lib/stages/restrict.rb
stages-0.2.10 lib/stages/restrict.rb
stages-0.2.9 lib/stages/restrict.rb
stages-0.2.8 lib/stages/restrict.rb
stages-0.2.7 lib/stages/restrict.rb
stages-0.2.6 lib/stages/restrict.rb
stages-0.2.5 lib/stages/restrict.rb
stages-0.2.4 lib/stages/restrict.rb
stages-0.2.3 lib/stages/restrict.rb
stages-0.2.2 lib/stages/restrict.rb
stages-0.2.1 lib/stages/restrict.rb