Class: Backup::Connection::Everbox
- Inherits:
-
Object
- Object
- Backup::Connection::Everbox
- Defined in:
- lib/backup/connection/everbox.rb
Defined Under Namespace
Classes: Session
Instance Attribute Summary collapse
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #connect ⇒ Object
-
#initialize(token, secret) ⇒ Everbox
constructor
A new instance of Everbox.
- #path ⇒ Object
- #session ⇒ Object
- #static_initialize(procedure) ⇒ Object
- #store ⇒ Object
Constructor Details
#initialize(token, secret) ⇒ Everbox
Returns a new instance of Everbox.
190 191 192 193 |
# File 'lib/backup/connection/everbox.rb', line 190 def initialize(token, secret) @token = token @secret = secret end |
Instance Attribute Details
#secret ⇒ Object
Returns the value of attribute secret.
188 189 190 |
# File 'lib/backup/connection/everbox.rb', line 188 def secret @secret end |
#token ⇒ Object
Returns the value of attribute token.
188 189 190 |
# File 'lib/backup/connection/everbox.rb', line 188 def token @token end |
Instance Method Details
#connect ⇒ Object
214 215 216 |
# File 'lib/backup/connection/everbox.rb', line 214 def connect session end |
#path ⇒ Object
218 219 220 |
# File 'lib/backup/connection/everbox.rb', line 218 def path @path || "backups" end |
#session ⇒ Object
200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/backup/connection/everbox.rb', line 200 def session opts = {} opts[:api_key] = token unless token.nil? opts[:secret_access_key] = secret unless secret.nil? @session ||= Session.new(opts) unless @session. @session. = token @session. = secret @session. end @session end |
#static_initialize(procedure) ⇒ Object
195 196 197 198 |
# File 'lib/backup/connection/everbox.rb', line 195 def static_initialize(procedure) self.procedure = procedure load_storage_configuration_attributes(true) end |
#store ⇒ Object
222 223 224 225 |
# File 'lib/backup/connection/everbox.rb', line 222 def store path_to_file = File.join(tmp_path, final_file) session.upload(path_to_file, path, :mode => :dropbox) end |