Class: CloudFilesTransfer::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud_files_transfer/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_keyObject

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

#connectionObject

Returns the value of attribute connection.



4
5
6
# File 'lib/cloud_files_transfer/client.rb', line 4

def connection
  @connection
end

#container_nameObject

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

#snetObject

Returns the value of attribute snet.



4
5
6
# File 'lib/cloud_files_transfer/client.rb', line 4

def snet
  @snet
end

#usernameObject

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