Class: Ethel::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/ethel/operation.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Operation

Returns a new instance of Operation.



3
4
5
# File 'lib/ethel/operation.rb', line 3

def initialize(*args)
  @child_operations = []
end

Instance Method Details

#before_transform(source, target) ⇒ Object



7
8
9
10
11
# File 'lib/ethel/operation.rb', line 7

def before_transform(source, target)
  @child_operations.each do |child_operation|
    child_operation.before_transform(source, target)
  end
end

#transform(row) ⇒ Object



13
14
15
16
17
# File 'lib/ethel/operation.rb', line 13

def transform(row)
  @child_operations.inject(row) do |row, child_operation|
    child_operation.transform(row)
  end
end