Class: CloudBackup::DriverStack
- Inherits:
-
Object
- Object
- CloudBackup::DriverStack
- Defined in:
- lib/driver_stack.rb
Instance Attribute Summary collapse
-
#max_items ⇒ Object
Returns the value of attribute max_items.
Instance Method Summary collapse
- #add_driver(konstant) ⇒ Object
- #add_file(name) ⇒ Object
- #add_files(array) ⇒ Object
- #addable?(driver) ⇒ Boolean
- #driver_initiate ⇒ Object
-
#initialize ⇒ DriverStack
constructor
A new instance of DriverStack.
- #list ⇒ Object
- #perform_backup! ⇒ Object
Constructor Details
#initialize ⇒ DriverStack
Returns a new instance of DriverStack.
7 8 9 10 11 |
# File 'lib/driver_stack.rb', line 7 def initialize @list = [] @max_items = 2 @file_names = [] end |
Instance Attribute Details
#max_items ⇒ Object
Returns the value of attribute max_items.
5 6 7 |
# File 'lib/driver_stack.rb', line 5 def max_items @max_items end |
Instance Method Details
#add_driver(konstant) ⇒ Object
21 22 23 |
# File 'lib/driver_stack.rb', line 21 def add_driver konstant @list << konstant end |
#add_file(name) ⇒ Object
25 26 27 |
# File 'lib/driver_stack.rb', line 25 def add_file name @file_names << name end |
#add_files(array) ⇒ Object
29 30 31 |
# File 'lib/driver_stack.rb', line 29 def add_files array @file_names = @file_names + array end |
#addable?(driver) ⇒ Boolean
17 18 19 |
# File 'lib/driver_stack.rb', line 17 def addable? driver driver.is_a? CloudBackup::Driver end |
#driver_initiate ⇒ Object
41 42 43 44 45 |
# File 'lib/driver_stack.rb', line 41 def driver_initiate @list.each do |driver| driver.initiate end end |
#list ⇒ Object
13 14 15 |
# File 'lib/driver_stack.rb', line 13 def list @list end |
#perform_backup! ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/driver_stack.rb', line 33 def perform_backup! driver_initiate driver_add_files driver_upload_files driver_remove_old_files driver_shut_down_execution end |