Class: Chicago::ETL::TransformationChain Private

Inherits:
Object
  • Object
show all
Defined in:
lib/chicago/etl/transformation_chain.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(*transforms) ⇒ TransformationChain

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of TransformationChain.



5
6
7
# File 'lib/chicago/etl/transformation_chain.rb', line 5

def initialize(*transforms)
  @transforms = transforms
end

Instance Method Details

#downstream_fields(fields) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/chicago/etl/transformation_chain.rb', line 29

def downstream_fields(fields)
  @transforms.inject(fields) {|t| t.downstream_fields(fields) }
end

#flushObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
23
# File 'lib/chicago/etl/transformation_chain.rb', line 19

def flush
  @transforms.inject([]) do |rows, transform|
    process_rows(rows, transform) + transform.flush
  end
end

#output_streamsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/chicago/etl/transformation_chain.rb', line 9

def output_streams
  @transforms.inject([]) {|s, t| s | t.output_streams }
end

#process(row) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
16
17
# File 'lib/chicago/etl/transformation_chain.rb', line 13

def process(row)
  @transforms.inject([row]) do |rows, transform|
    process_rows(rows, transform)
  end
end

#upstream_fields(fields) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
# File 'lib/chicago/etl/transformation_chain.rb', line 25

def upstream_fields(fields)
  @transforms.inject(fields) {|t| t.upstream_fields(fields) }
end