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