Module: TencentCosSdk

Defined in:
lib/tencent_cos_sdk.rb,
lib/tencent_cos_sdk/utils.rb,
lib/tencent_cos_sdk/request.rb,
lib/tencent_cos_sdk/version.rb,
lib/tencent_cos_sdk/configuration.rb

Defined Under Namespace

Classes: Configuration, Request

Constant Summary collapse

VERSION =
"0.2.2"

Class Method Summary collapse

Class Method Details

.confObject



13
14
15
# File 'lib/tencent_cos_sdk/configuration.rb', line 13

def conf
    @conf
end

.configure {|@conf| ... } ⇒ Object

Yields:



7
8
9
10
11
# File 'lib/tencent_cos_sdk/configuration.rb', line 7

def configure
    @conf ||= Configuration.new
    yield @conf
    @conf
end

.delete(path, options = {}) ⇒ Object

TencentCosSdk.delete '1/abc.txt'



25
26
27
# File 'lib/tencent_cos_sdk.rb', line 25

def delete path, options = {}
    Request.new(options.merge http_method: 'delete', path: path, sign: true).execute
end

.get(path, options = {}) ⇒ Object

TencentCosSdk.get '1/abc.txt'



18
19
20
# File 'lib/tencent_cos_sdk.rb', line 18

def get path, options = {}
    Request.new(options.merge http_method: 'get', path: path).execute
end

.put(path, options = {}) ⇒ Object

TencentCosSdk.put '1/abc.txt', body: 'abc123' TencentCosSdk.put '1/abc.txt', file: './xyz.txt'



11
12
13
# File 'lib/tencent_cos_sdk.rb', line 11

def put path, options = {}
    Request.new(options.merge http_method: 'put', path: path, sign: true).execute
end

.uri(path) ⇒ Object



6
7
8
# File 'lib/tencent_cos_sdk/utils.rb', line 6

def uri(path)
    "#{TencentCosSdk.conf.parent_path.to_s}/#{path}"
end

.url(path) ⇒ Object



10
11
12
# File 'lib/tencent_cos_sdk/utils.rb', line 10

def url(path)
    "https://#{TencentCosSdk.conf.host}#{uri path}"
end