Class: Backup::Storage::Base
- Inherits:
-
Object
- Object
- Backup::Storage::Base
- Includes:
- Configuration::Helpers
- Defined in:
- lib/backup/storage/base.rb
Instance Attribute Summary collapse
-
#keep ⇒ Object
Sets the limit to how many backups to keep in the remote location.
-
#storage_id ⇒ Object
(Optional) User-defined string used to uniquely identify multiple storages of the same type.
Instance Method Summary collapse
-
#initialize(model, storage_id = nil) ⇒ Base
constructor
Creates a new instance of the storage object * Called with super(model, storage_id) from each subclass.
-
#perform! ⇒ Object
Performs the backup transfer.
Methods included from Configuration::Helpers
Constructor Details
#initialize(model, storage_id = nil) ⇒ Base
Creates a new instance of the storage object
-
Called with super(model, storage_id) from each subclass
23 24 25 26 27 |
# File 'lib/backup/storage/base.rb', line 23 def initialize(model, storage_id = nil) load_defaults! @model = model @storage_id = storage_id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Configuration::Helpers
Instance Attribute Details
#keep ⇒ Object
Sets the limit to how many backups to keep in the remote location. If exceeded, the oldest will be removed to make room for the newest
11 12 13 |
# File 'lib/backup/storage/base.rb', line 11 def keep @keep end |
#storage_id ⇒ Object
(Optional) User-defined string used to uniquely identify multiple storages of the same type. This will be appended to the YAML storage file used for cycling backups.
18 19 20 |
# File 'lib/backup/storage/base.rb', line 18 def storage_id @storage_id end |
Instance Method Details
#perform! ⇒ Object
Performs the backup transfer
31 32 33 34 35 |
# File 'lib/backup/storage/base.rb', line 31 def perform! @package = @model.package transfer! cycle! end |