Class: CloudFilesTransfer::Client
- Inherits:
-
Object
- Object
- CloudFilesTransfer::Client
- Defined in:
- lib/cloud_files_transfer/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#container_name ⇒ Object
Returns the value of attribute container_name.
-
#snet ⇒ Object
Returns the value of attribute snet.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #container(name = container_name) ⇒ Object
-
#initialize(args = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(args = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 |
# File 'lib/cloud_files_transfer/client.rb', line 6 def initialize(args={}) @username = args.fetch(:username) { raise 'Missing username'} @api_key = args.fetch(:api_key) { raise 'Missing api_key'} @container_name = args.fetch(:container) { raise 'Missing container'} @snet = args.fetch(:snet, false) @connection = args.fetch(:connection, create_connection) end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/cloud_files_transfer/client.rb', line 4 def api_key @api_key end |
#connection ⇒ Object
Returns the value of attribute connection.
4 5 6 |
# File 'lib/cloud_files_transfer/client.rb', line 4 def connection @connection end |
#container_name ⇒ Object
Returns the value of attribute container_name.
4 5 6 |
# File 'lib/cloud_files_transfer/client.rb', line 4 def container_name @container_name end |
#snet ⇒ Object
Returns the value of attribute snet.
4 5 6 |
# File 'lib/cloud_files_transfer/client.rb', line 4 def snet @snet end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/cloud_files_transfer/client.rb', line 4 def username @username end |
Instance Method Details
#container(name = container_name) ⇒ Object
14 15 16 |
# File 'lib/cloud_files_transfer/client.rb', line 14 def container(name=container_name) @container ||= connection.container(name) end |