Class: Backup::Storage::Dropbox
- Defined in:
- lib/backup/storage/dropbox.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Dropbox API credentials.
-
#api_secret ⇒ Object
Dropbox API credentials.
-
#email ⇒ Object
Dropbox user credentials.
-
#password ⇒ Object
Dropbox user credentials.
-
#path ⇒ Object
Path to where the backups will be stored.
-
#timeout ⇒ Object
Dropbox connection timeout.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(&block) ⇒ Dropbox
constructor
Creates a new instance of the Dropbox storage object First it sets the defaults (if any exist) and then evaluates the configuration block which may overwrite these defaults.
-
#perform! ⇒ Object
Performs the backup transfer.
-
#remote_path ⇒ Object
This is the remote path to where the backup files will be stored.
Methods inherited from Base
#cycle!, #local_file, #local_path, #provider, #remote_file
Methods included from Configuration::Helpers
#clear_defaults!, #getter_methods, #load_defaults!, #setter_methods
Constructor Details
#initialize(&block) ⇒ Dropbox
Creates a new instance of the Dropbox storage object First it sets the defaults (if any exist) and then evaluates the configuration block which may overwrite these defaults
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/backup/storage/dropbox.rb', line 31 def initialize(&block) load_defaults! @path ||= 'backups' instance_eval(&block) if block_given? @timeout ||= 300 @time = TIME end |
Instance Attribute Details
#api_key ⇒ Object
Dropbox API credentials
17 18 19 |
# File 'lib/backup/storage/dropbox.rb', line 17 def api_key @api_key end |
#api_secret ⇒ Object
Dropbox API credentials
17 18 19 |
# File 'lib/backup/storage/dropbox.rb', line 17 def api_secret @api_secret end |
#email ⇒ Object
Dropbox user credentials
13 14 15 |
# File 'lib/backup/storage/dropbox.rb', line 13 def email @email end |
#password ⇒ Object
Dropbox user credentials
13 14 15 |
# File 'lib/backup/storage/dropbox.rb', line 13 def password @password end |
#path ⇒ Object
Path to where the backups will be stored
21 22 23 |
# File 'lib/backup/storage/dropbox.rb', line 21 def path @path end |
#timeout ⇒ Object
Dropbox connection timeout
25 26 27 |
# File 'lib/backup/storage/dropbox.rb', line 25 def timeout @timeout end |
Instance Method Details
#perform! ⇒ Object
Performs the backup transfer
50 51 52 53 |
# File 'lib/backup/storage/dropbox.rb', line 50 def perform! transfer! cycle! end |
#remote_path ⇒ Object
This is the remote path to where the backup files will be stored
44 45 46 |
# File 'lib/backup/storage/dropbox.rb', line 44 def remote_path File.join(path, TRIGGER) end |