Class: Backup::Storage::Dropbox
- Includes:
- Cycler
- Defined in:
- lib/backup/storage/dropbox.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#access_type ⇒ Object
Dropbox Access Type Valid values are: :app_folder (default) :dropbox (full access).
-
#api_key ⇒ Object
Dropbox API credentials.
-
#api_secret ⇒ Object
Dropbox API credentials.
-
#cache_path ⇒ Object
Path to store cached authorized session.
-
#chunk_size ⇒ Object
Chunk size, specified in MiB, for the ChunkedUploader.
-
#max_retries ⇒ Object
Number of times to retry failed operations.
-
#retry_waitsec ⇒ Object
Time in seconds to pause before each retry.
Attributes inherited from Base
#keep, #model, #package, #path, #storage_id
Instance Method Summary collapse
-
#initialize(model, storage_id = nil) ⇒ Dropbox
constructor
Creates a new instance of the storage object.
Methods inherited from Base
Methods included from Config::Helpers
Constructor Details
#initialize(model, storage_id = nil) ⇒ Dropbox
Creates a new instance of the storage object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/backup/storage/dropbox.rb', line 49 def initialize(model, storage_id = nil) super @path ||= "backups" @cache_path ||= ".cache" @access_type ||= :app_folder @chunk_size ||= 4 # MiB @max_retries ||= 10 @retry_waitsec ||= 30 path.sub!(/^\//, "") end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers
Instance Attribute Details
#access_type ⇒ Object
Dropbox Access Type Valid values are:
:app_folder (default)
:dropbox (full access)
29 30 31 |
# File 'lib/backup/storage/dropbox.rb', line 29 def access_type @access_type end |
#api_key ⇒ Object
Dropbox API credentials
11 12 13 |
# File 'lib/backup/storage/dropbox.rb', line 11 def api_key @api_key end |
#api_secret ⇒ Object
Dropbox API credentials
11 12 13 |
# File 'lib/backup/storage/dropbox.rb', line 11 def api_secret @api_secret end |
#cache_path ⇒ Object
Path to store cached authorized session.
Relative paths will be expanded using Config.root_path, which by default is ~/Backup unless –root-path was used on the command line or set in config.rb.
By default, cache_path is ‘.cache’, which would be ‘~/Backup/.cache/’ if using the default root_path.
22 23 24 |
# File 'lib/backup/storage/dropbox.rb', line 22 def cache_path @cache_path end |
#chunk_size ⇒ Object
Chunk size, specified in MiB, for the ChunkedUploader.
33 34 35 |
# File 'lib/backup/storage/dropbox.rb', line 33 def chunk_size @chunk_size end |
#max_retries ⇒ Object
Number of times to retry failed operations.
Default: 10
39 40 41 |
# File 'lib/backup/storage/dropbox.rb', line 39 def max_retries @max_retries end |
#retry_waitsec ⇒ Object
Time in seconds to pause before each retry.
Default: 30
45 46 47 |
# File 'lib/backup/storage/dropbox.rb', line 45 def retry_waitsec @retry_waitsec end |