Class: ETL::Processor::SequenceProcessor

Inherits:
RowProcessor show all
Defined in:
lib/etl/processor/sequence_processor.rb

Overview

Row level processor to generate a sequence.

Configuration options:

  • :context: A context name, if none is specified then the context will be the current ETL run

  • :dest: The destination field name

Instance Method Summary collapse

Methods inherited from RowProcessor

#ensure_columns_available_in_row!, #initialize

Methods inherited from Processor

#initialize

Constructor Details

This class inherits a constructor from ETL::Processor::RowProcessor

Instance Method Details

#process(row) ⇒ Object



10
11
12
13
14
# File 'lib/etl/processor/sequence_processor.rb', line 10

def process(row)
  sequences[configuration[:context]] ||= 0
  row[configuration[:dest]] = sequences[configuration[:context]] += 1
  row
end