Class: Siba::SibaTask
- Inherits:
-
Object
- Object
- Siba::SibaTask
- Includes:
- LoggerPlug
- Defined in:
- lib/siba/tasks/siba_task.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#options ⇒ Object
Returns the value of attribute options.
-
#plugin ⇒ Object
Returns the value of attribute plugin.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #backup(*args) ⇒ Object
-
#initialize(options, category) ⇒ SibaTask
constructor
A new instance of SibaTask.
- #restore(*args) ⇒ Object
Methods included from LoggerPlug
close, create, logger, #logger, opened?
Constructor Details
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
7 8 9 |
# File 'lib/siba/tasks/siba_task.rb', line 7 def category @category end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/siba/tasks/siba_task.rb', line 7 def @options end |
#plugin ⇒ Object
Returns the value of attribute plugin.
7 8 9 |
# File 'lib/siba/tasks/siba_task.rb', line 7 def plugin @plugin end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/siba/tasks/siba_task.rb', line 7 def type @type end |
Instance Method Details
#backup(*args) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/siba/tasks/siba_task.rb', line 17 def backup(*args) logger.debug "Running #{category}/#{type}" @plugin.backup *args rescue Exception logger.error "Failed to backup #{category}/#{type}" raise end |
#restore(*args) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/siba/tasks/siba_task.rb', line 25 def restore(*args) logger.debug "Restoring #{category}/#{type}" @plugin.restore *args rescue Exception logger.error "Failed to restore #{category}/#{type}" raise end |