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
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
19 20 21 22 23 24 25 26 |
# File 'lib/attached/storage/rackspace.rb', line 19 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.
10 11 12 |
# File 'lib/attached/storage/rackspace.rb', line 10 def api_key @api_key end |
#container ⇒ Object (readonly)
Returns the value of attribute container.
8 9 10 |
# File 'lib/attached/storage/rackspace.rb', line 8 def container @container end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
9 10 11 |
# File 'lib/attached/storage/rackspace.rb', line 9 def username @username end |
Instance Method Details
#host ⇒ Object
34 35 36 |
# File 'lib/attached/storage/rackspace.rb', line 34 def host() "https://storage.clouddrive.com/#{self.container}/" end |