Class: ETL::Batch::Context

Inherits:
Object show all
Defined in:
lib/etl/batch/batch.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(batch) ⇒ Context

Returns a new instance of Context.



13
14
15
# File 'lib/etl/batch/batch.rb', line 13

def initialize(batch)
  @batch = batch
end

Instance Attribute Details

#batchObject (readonly)

Returns the value of attribute batch.



4
5
6
# File 'lib/etl/batch/batch.rb', line 4

def batch
  @batch
end

Class Method Details

.create(batch) ⇒ Object

Create a context that is used when evaluating the batch file



8
9
10
# File 'lib/etl/batch/batch.rb', line 8

def create(batch)
  Context.new(batch).get_binding
end

Instance Method Details

#fileObject



17
18
19
# File 'lib/etl/batch/batch.rb', line 17

def file
  batch.file
end

#get_bindingObject



21
22
23
# File 'lib/etl/batch/batch.rb', line 21

def get_binding
  binding
end

#run(file) ⇒ Object



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

def run(file)
  batch.run(File.dirname(self.file) + "/" + file)
end

#use_temp_tables(value = true) ⇒ Object



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

def use_temp_tables(value=true)
  batch.use_temp_tables(value)
end