Sha256: 450d5a52f48f602d22931580afb95914065d7e4f2a73f30f0b2bfcea1961d204

Contents?: true

Size: 398 Bytes

Versions: 7

Compression:

Stored size: 398 Bytes

Contents

module CsvPiper
  module Processors
    class CollectOutput
      attr_reader :output
      def initialize(collect_when_invalid: true)
        @output = []
        @collect_when_invalid = collect_when_invalid
      end

      def process(source, transformed, errors)
        @output << transformed if @collect_when_invalid || errors.empty?
        [transformed, errors]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
csv_piper-0.1.7 lib/csv_piper/processors/collect_output.rb
csv_piper-0.1.6 lib/csv_piper/processors/collect_output.rb
csv_piper-0.1.5 lib/csv_piper/processors/collect_output.rb
csv_piper-0.1.4 lib/csv_piper/processors/collect_output.rb
csv_piper-0.1.3 lib/csv_piper/processors/collect_output.rb
csv_piper-0.1.2 lib/csv_piper/processors/collect_output.rb
csv_piper-0.1.1 lib/csv_piper/processors/collect_output.rb