Class: ETL::Screen::RowCountScreen
- Defined in:
- lib/etl/screen/row_count_screen.rb
Overview
This screen validates the number of rows which will be bulk loaded against the results from some sort of a row count query. If there is a difference then the screen will not pass
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#control ⇒ Object
Returns the value of attribute control.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(control, configuration = {}) ⇒ RowCountScreen
constructor
A new instance of RowCountScreen.
Constructor Details
#initialize(control, configuration = {}) ⇒ RowCountScreen
Returns a new instance of RowCountScreen.
8 9 10 11 12 |
# File 'lib/etl/screen/row_count_screen.rb', line 8 def initialize(control, configuration={}) @control = control @configuration = configuration execute end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
7 8 9 |
# File 'lib/etl/screen/row_count_screen.rb', line 7 def configuration @configuration end |
#control ⇒ Object
Returns the value of attribute control.
7 8 9 |
# File 'lib/etl/screen/row_count_screen.rb', line 7 def control @control end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 |
# File 'lib/etl/screen/row_count_screen.rb', line 13 def execute unless Engine.rows_written == configuration[:rows] raise "Rows written (#{Engine.rows_written}) does not match expected rows (#{configuration[:rows]})" end end |