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.
196 197 198 199 |
# File 'lib/backup/connection/everbox.rb', line 196 def initialize(token, secret) @token = token @secret = secret end |
Instance Attribute Details
#secret ⇒ Object
Returns the value of attribute secret.
194 195 196 |
# File 'lib/backup/connection/everbox.rb', line 194 def secret @secret end |
#token ⇒ Object
Returns the value of attribute token.
194 195 196 |
# File 'lib/backup/connection/everbox.rb', line 194 def token @token end |
Instance Method Details
#connect ⇒ Object
220 221 222 |
# File 'lib/backup/connection/everbox.rb', line 220 def connect session end |
#path ⇒ Object
224 225 226 |
# File 'lib/backup/connection/everbox.rb', line 224 def path @path || "backups" end |
#session ⇒ Object
206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/backup/connection/everbox.rb', line 206 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
201 202 203 204 |
# File 'lib/backup/connection/everbox.rb', line 201 def static_initialize(procedure) self.procedure = procedure load_storage_configuration_attributes(true) end |
#store ⇒ Object
228 229 230 231 |
# File 'lib/backup/connection/everbox.rb', line 228 def store path_to_file = File.join(tmp_path, final_file) session.upload(path_to_file, path, :mode => :dropbox) end |