Class: BeetleETL::Step
- Inherits:
-
Object
show all
- Defined in:
- lib/beetle_etl/steps/step.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(config, table_name) ⇒ Step
Returns a new instance of Step.
7
8
9
10
|
# File 'lib/beetle_etl/steps/step.rb', line 7
def initialize(config, table_name)
@config = config
@table_name = table_name
end
|
Instance Attribute Details
#table_name ⇒ Object
Returns the value of attribute table_name.
5
6
7
|
# File 'lib/beetle_etl/steps/step.rb', line 5
def table_name
@table_name
end
|
Class Method Details
.step_name(table_name) ⇒ Object
12
13
14
|
# File 'lib/beetle_etl/steps/step.rb', line 12
def self.step_name(table_name)
"#{table_name}: #{name.split('::').last}"
end
|
Instance Method Details
#database ⇒ Object
28
29
30
|
# File 'lib/beetle_etl/steps/step.rb', line 28
def database
@config.database
end
|
#dependencies ⇒ Object
20
21
22
|
# File 'lib/beetle_etl/steps/step.rb', line 20
def dependencies
Set.new
end
|
#external_source ⇒ Object
24
25
26
|
# File 'lib/beetle_etl/steps/step.rb', line 24
def external_source
@config.external_source
end
|
#name ⇒ Object
16
17
18
|
# File 'lib/beetle_etl/steps/step.rb', line 16
def name
self.class.step_name(table_name)
end
|
#stage_table_name(table_name = nil) ⇒ Object
36
37
38
|
# File 'lib/beetle_etl/steps/step.rb', line 36
def stage_table_name(table_name = nil)
BeetleETL::Naming.stage_table_name(external_source, table_name || @table_name)
end
|
#target_schema ⇒ Object
32
33
34
|
# File 'lib/beetle_etl/steps/step.rb', line 32
def target_schema
@config.target_schema
end
|