Class: Backup::Storage::Dropbox

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/storage/dropbox.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#keep, #storage_id

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Configuration::Helpers

#clear_defaults!, #load_defaults!

Constructor Details

#initialize(model, storage_id = nil, &block) ⇒ Dropbox

Creates a new instance of the storage object



36
37
38
39
40
41
42
43
# File 'lib/backup/storage/dropbox.rb', line 36

def initialize(model, storage_id = nil, &block)
  super(model, storage_id)

  @path ||= 'backups'
  @access_type ||= :app_folder

  instance_eval(&block) if block_given?
end

Instance Attribute Details

#access_typeObject

Dropbox Access Type Valid values are:

:app_folder (default)
:dropbox (full access)


20
21
22
# File 'lib/backup/storage/dropbox.rb', line 20

def access_type
  @access_type
end

#api_keyObject

Dropbox API credentials



13
14
15
# File 'lib/backup/storage/dropbox.rb', line 13

def api_key
  @api_key
end

#api_secretObject

Dropbox API credentials



13
14
15
# File 'lib/backup/storage/dropbox.rb', line 13

def api_secret
  @api_secret
end

#pathObject

Path to where the backups will be stored



24
25
26
# File 'lib/backup/storage/dropbox.rb', line 24

def path
  @path
end

Instance Method Details

#timeout=(value) ⇒ Object

Deprecated as of v3.0.21 - for move to official ‘dropbox-sdk’ gem (v1.1)



27
28
29
30
31
32
# File 'lib/backup/storage/dropbox.rb', line 27

def timeout=(value)
  if value
    Logger.warn "[DEPRECATED] Backup::Storage::Dropbox.timeout=\n" +
        "  is deprecated and will be removed at some point."
  end
end