Class: ETL::Processor::BlockProcessor

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

Overview

This processor is both a valid RowProcessor (called on each row with after_read) or a Processor (called once on pre_process or post_process)

Instance Method Summary collapse

Constructor Details

#initialize(control, configuration) ⇒ BlockProcessor

Returns a new instance of BlockProcessor.



5
6
7
8
# File 'lib/etl/processor/block_processor.rb', line 5

def initialize(control, configuration)
  super
  @block = configuration[:block]
end

Instance Method Details

#process(row = nil) ⇒ Object



9
10
11
# File 'lib/etl/processor/block_processor.rb', line 9

def process(row=nil)
  @block.call(row)
end