Class: MiniEtl::Process
- Inherits:
-
Object
- Object
- MiniEtl::Process
- Includes:
- Status
- Defined in:
- lib/mini_etl/process.rb
Overview
ETL Process wrapper Should this go all the way? Probably
Constant Summary collapse
- VALID_STATES =
{ initialized: 0, bootstrapped: 1, generated: 2, finished: 3, failed: 4 }.freeze
Constants included from Status
Instance Attribute Summary collapse
-
#generator ⇒ Object
readonly
Returns the value of attribute generator.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #bootstrap ⇒ Object
- #generate ⇒ Object
-
#initialize ⇒ Process
constructor
A new instance of Process.
Methods included from Status
Constructor Details
Instance Attribute Details
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
17 18 19 |
# File 'lib/mini_etl/process.rb', line 17 def generator @generator end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
17 18 19 |
# File 'lib/mini_etl/process.rb', line 17 def source @source end |
Instance Method Details
#bootstrap ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/mini_etl/process.rb', line 26 def bootstrap if initialized? && @source.validate @source.fetch @generator.bootstrap(@source.type, @source.payload) bootstrapped! else failed! end end |
#generate ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/mini_etl/process.rb', line 36 def generate # TODO: Parse it, bear in mind this will be in memory and may need to be split # TODO: Transform it into useful bits # This may be done in rails. Provide a useful interface in that case # TODO: Load the thing wherever it needs to go if bootstrapped? @generator.transform generated! else failed! end end |