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

included

Constructor Details

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

Creates a new instance of the storage object



33
34
35
36
37
38
39
40
# File 'lib/backup/storage/dropbox.rb', line 33

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

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

  instance_eval(&block) if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Configuration::Helpers

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