Class: DBPurger::Executor
- Inherits:
-
Object
- Object
- DBPurger::Executor
- Defined in:
- lib/db-purger/executor.rb
Overview
DBPurger::Executor used to execute a purge plan with verification
Instance Attribute Summary collapse
-
#error_io ⇒ Object
writeonly
Sets the attribute error_io.
Instance Method Summary collapse
-
#initialize(database, plan, options = {}) ⇒ Executor
constructor
A new instance of Executor.
- #purge!(purge_value) ⇒ Object
- #verify! ⇒ Object
Constructor Details
Instance Attribute Details
#error_io=(value) ⇒ Object (writeonly)
Sets the attribute error_io
6 7 8 |
# File 'lib/db-purger/executor.rb', line 6 def error_io=(value) @error_io = value end |
Instance Method Details
#purge!(purge_value) ⇒ Object
15 16 17 18 19 |
# File 'lib/db-purger/executor.rb', line 15 def purge!(purge_value) raise('purge_value is nil') if purge_value.nil? @plan.purge!(@database, purge_value) end |
#verify! ⇒ Object
21 22 23 24 25 26 |
# File 'lib/db-purger/executor.rb', line 21 def verify! return if plan_validator.valid? output_plan_errors raise('purge plan failed verification') end |