Class: BeetleETL::TransformationLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/beetle_etl/dsl/transformation_loader.rb

Instance Method Summary collapse

Constructor Details

#initializeTransformationLoader

Returns a new instance of TransformationLoader.



4
5
6
7
# File 'lib/beetle_etl/dsl/transformation_loader.rb', line 4

def initialize
  @transformations = []
  @helper_definitions = nil
end

Instance Method Details

#loadObject



9
10
11
12
13
14
15
16
17
# File 'lib/beetle_etl/dsl/transformation_loader.rb', line 9

def load
  File.open(BeetleETL.config.transformation_file, 'r') do |file|
    instance_eval file.read
  end

  @transformations.map do |(table_name, setup)|
    Transformation.new(table_name, setup, @helper_definitions)
  end
end