Class: Setl::ETL
- Inherits:
-
Object
- Object
- Setl::ETL
- Defined in:
- lib/setl/etl.rb
Instance Attribute Summary collapse
-
#last_row ⇒ Object
readonly
Returns the value of attribute last_row.
Instance Method Summary collapse
-
#initialize(source, destination, transform, stop_on_errors: false, error_handler: nil) ⇒ ETL
constructor
A new instance of ETL.
- #process ⇒ Object
Constructor Details
#initialize(source, destination, transform, stop_on_errors: false, error_handler: nil) ⇒ ETL
Returns a new instance of ETL.
5 6 7 8 9 10 11 12 |
# File 'lib/setl/etl.rb', line 5 def initialize(source, destination, transform, stop_on_errors: false, error_handler: nil) @stop_on_errors = stop_on_errors @error_handler = error_handler || DefaultHandler.new(stop_on_errors) @source = Source.new(source, @error_handler) @destination = Destination.new(destination, @error_handler) @transform = Transform.new(transform, @error_handler) end |
Instance Attribute Details
#last_row ⇒ Object (readonly)
Returns the value of attribute last_row.
22 23 24 |
# File 'lib/setl/etl.rb', line 22 def last_row @last_row end |
Instance Method Details
#process ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/setl/etl.rb', line 14 def process source.each do |row| @last_row = row destination.(transform.(row)) end end |