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
      50 51 52 53 54 55 56 57 58 59 60  | 
    
      # File 'lib/backup/storage/dropbox.rb', line 50 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)
  
      30 31 32  | 
    
      # File 'lib/backup/storage/dropbox.rb', line 30 def access_type @access_type end  | 
  
#api_key ⇒ Object
Dropbox API credentials
      12 13 14  | 
    
      # File 'lib/backup/storage/dropbox.rb', line 12 def api_key @api_key end  | 
  
#api_secret ⇒ Object
Dropbox API credentials
      12 13 14  | 
    
      # File 'lib/backup/storage/dropbox.rb', line 12 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.
      23 24 25  | 
    
      # File 'lib/backup/storage/dropbox.rb', line 23 def cache_path @cache_path end  | 
  
#chunk_size ⇒ Object
Chunk size, specified in MiB, for the ChunkedUploader.
      34 35 36  | 
    
      # File 'lib/backup/storage/dropbox.rb', line 34 def chunk_size @chunk_size end  | 
  
#max_retries ⇒ Object
Number of times to retry failed operations.
Default: 10
      40 41 42  | 
    
      # File 'lib/backup/storage/dropbox.rb', line 40 def max_retries @max_retries end  | 
  
#retry_waitsec ⇒ Object
Time in seconds to pause before each retry.
Default: 30
      46 47 48  | 
    
      # File 'lib/backup/storage/dropbox.rb', line 46 def retry_waitsec @retry_waitsec end  |