Class: Attached::Storage::Rackspace
- Defined in:
- lib/attached/storage/rackspace.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Attributes inherited from Fog
#access_key_id, #bucket, #defaults, #secret_access_key
Instance Method Summary collapse
-
#host ⇒ Object
Access the host (e.g. storage.clouddrive.com/container) for a storage service.
-
#initialize(credentials) ⇒ Rackspace
constructor
Create a new interface supporting save and destroy operations.
Methods inherited from Fog
Methods inherited from Base
#destroy, #options, #parse, #retrieve, #save
Constructor Details
#initialize(credentials) ⇒ Rackspace
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/attached/storage/rackspace.rb', line 22 def initialize(credentials) super credentials = parse(credentials) @container = credentials[:container] || credentials['container'] @username = credentials[:username] || credentials['username'] @api_key = credentials[:api_key] || credentials['api_key'] raise "'container' must be specified if using 'rackspace' for storage" unless @container end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
12 13 14 |
# File 'lib/attached/storage/rackspace.rb', line 12 def api_key @api_key end |
#container ⇒ Object (readonly)
Returns the value of attribute container.
10 11 12 |
# File 'lib/attached/storage/rackspace.rb', line 10 def container @container end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
11 12 13 |
# File 'lib/attached/storage/rackspace.rb', line 11 def username @username end |
Instance Method Details
#host ⇒ Object
41 42 43 |
# File 'lib/attached/storage/rackspace.rb', line 41 def host() "https://storage.clouddrive.com/#{self.container}/" end |