Class: Backup::Performer
- Inherits:
-
Object
- Object
- Backup::Performer
- Defined in:
- lib/backup-agent/performer.rb
Instance Method Summary collapse
- #directory(path, options = {}) ⇒ Object
-
#initialize(storages) ⇒ Performer
constructor
A new instance of Performer.
- #mysql(options) ⇒ Object
-
#task(arg) ⇒ Object
task Task => [:foo, :bar, :baz].
Constructor Details
Instance Method Details
#directory(path, options = {}) ⇒ Object
25 26 27 |
# File 'lib/backup-agent/performer.rb', line 25 def directory(path, = {}) task Backup::Tasks::Directory => [path, ] end |
#mysql(options) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/backup-agent/performer.rb', line 18 def mysql() if Symbol === [:credentials] [:credentials] = credentials(mysql: [:credentials]) end task Backup::Tasks::MySQL => [] end |
#task(arg) ⇒ Object
task Task => [:foo, :bar, :baz]
11 12 13 14 15 16 |
# File 'lib/backup-agent/performer.rb', line 11 def task(arg) arg.each do |klass, args| @storages.each { |storage| klass.new(*args).perform(storage) } end nil end |