Sha256: d4d9c95a5630447da9a97ec5471a1e405613c56a4631d5357988a74eee49af71

Contents?: true

Size: 733 Bytes

Versions: 23

Compression:

Stored size: 733 Bytes

Contents

module ETL #:nodoc:
  module Processor #:nodoc:
    # A processor which requires that the particular fields are non-blank in
    # order for the row to be retained.
    class RequireNonBlankProcessor < ETL::Processor::RowProcessor
      # An array of fields to check
      attr_reader :fields
      
      # Initialize the processor
      #
      # Options:
      # * <tt>:fields</tt>: An array of fields to check, for example:
      #   [:first_name,:last_name]
      def initialize(control, configuration)
        super
        @fields = configuration[:fields] || []
      end
      
      # Process the row.
      def process(row)
        fields.each { |field| return if row[field].blank? }
        row
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 9 rubygems

Version Path
aeden-activewarehouse-etl-0.9.1 etl/lib/etl/processor/require_non_blank_processor.rb
colincasey-activewarehouse-etl-0.9.4 lib/etl/processor/require_non_blank_processor.rb
colincasey-activewarehouse-etl-0.9.5 lib/etl/processor/require_non_blank_processor.rb
factorylabs-activewarehouse-etl-0.9.1.2 lib/etl/processor/require_non_blank_processor.rb
factorylabs-activewarehouse-etl-0.9.1.3 lib/etl/processor/require_non_blank_processor.rb
factorylabs-activewarehouse-etl-0.9.1.4 lib/etl/processor/require_non_blank_processor.rb
factorylabs-activewarehouse-etl-0.9.1.5 lib/etl/processor/require_non_blank_processor.rb
factorylabs-activewarehouse-etl-0.9.1.6 lib/etl/processor/require_non_blank_processor.rb
factorylabs-activewarehouse-etl-0.9.1.7 lib/etl/processor/require_non_blank_processor.rb
jayzes-activewarehouse-etl-0.9.1.1 lib/etl/processor/require_non_blank_processor.rb
jayzes-activewarehouse-etl-0.9.1.2 lib/etl/processor/require_non_blank_processor.rb
jayzes-activewarehouse-etl-0.9.1 lib/etl/processor/require_non_blank_processor.rb
activewarehouse-etl-1.0.0 lib/etl/processor/require_non_blank_processor.rb
activewarehouse-etl-1.0.0.rc1 lib/etl/processor/require_non_blank_processor.rb
etl-0.9.5.rc1 lib/etl/processor/require_non_blank_processor.rb
activewarehouse-etl-sgonyea-0.9.6 lib/etl/processor/require_non_blank_processor.rb
activewarehouse-etl-0.9.5.rc1 lib/etl/processor/require_non_blank_processor.rb
darrell-activewarehouse-etl-0.9.1.6 lib/etl/processor/require_non_blank_processor.rb
darrell-activewarehouse-etl-0.9.1.4 lib/etl/processor/require_non_blank_processor.rb
factorylabs-activewarehouse-etl-0.9.1.8 lib/etl/processor/require_non_blank_processor.rb