Class: Backup::Storage::Base
- Inherits:
-
Object
- Object
- Backup::Storage::Base
- Includes:
- Config::Helpers
- Defined in:
- lib/backup/storage/base.rb
Instance Attribute Summary collapse
- #keep ⇒ Integer|Time
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
-
#path ⇒ Object
Base path on the remote where backup package files will be stored.
-
#storage_id ⇒ Object
readonly
Returns the value of attribute storage_id.
Instance Method Summary collapse
-
#initialize(model, storage_id = nil, &block) ⇒ Base
constructor
storage_id
is a user-defined string used to uniquely identify multiple storages of the same type. - #perform! ⇒ Object
Methods included from Config::Helpers
Constructor Details
#initialize(model, storage_id = nil, &block) ⇒ Base
storage_id
is a user-defined string used to uniquely identify multiple storages of the same type. If multiple storages of the same type are added to a single backup model, this identifier must be set. This will be appended to the YAML storage file used for cycling backups.
34 35 36 37 38 39 40 41 |
# File 'lib/backup/storage/base.rb', line 34 def initialize(model, storage_id = nil, &block) @model = model @package = model.package @storage_id = storage_id.to_s.gsub(/\W/, '_') if storage_id load_defaults! instance_eval(&block) if block_given? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers
Instance Attribute Details
#keep ⇒ Integer|Time
25 26 27 |
# File 'lib/backup/storage/base.rb', line 25 def keep @keep end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
27 28 29 |
# File 'lib/backup/storage/base.rb', line 27 def model @model end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
27 28 29 |
# File 'lib/backup/storage/base.rb', line 27 def package @package end |
#path ⇒ Object
Base path on the remote where backup package files will be stored.
10 11 12 |
# File 'lib/backup/storage/base.rb', line 10 def path @path end |
#storage_id ⇒ Object (readonly)
Returns the value of attribute storage_id.
27 28 29 |
# File 'lib/backup/storage/base.rb', line 27 def storage_id @storage_id end |