Class: COS::Client
- Inherits:
-
Object
- Object
- COS::Client
- Defined in:
- lib/cos/client.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#bucket(bucket_name = nil) ⇒ COS::Bucket
指定bucket 初始化Bucket类.
-
#initialize(options = {}) ⇒ COS::Client
constructor
初始化.
-
#signature ⇒ COS::Signature
获取鉴权签名方法.
Constructor Details
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
7 8 9 |
# File 'lib/cos/client.rb', line 7 def api @api end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/cos/client.rb', line 7 def config @config end |
Instance Method Details
#bucket(bucket_name = nil) ⇒ COS::Bucket
Note:
SDK会自动获取bucket的信息,包括读取权限等并进行缓存如需在后台修改了bucket信息请重新初始化Client
指定bucket 初始化Bucket类
48 49 50 51 52 53 54 |
# File 'lib/cos/client.rb', line 48 def bucket(bucket_name = nil) unless @cache_buckets[bucket_name] # 缓存bucket对象 @cache_buckets[bucket_name] = Bucket.new(self, bucket_name) end @cache_buckets[bucket_name] end |
#signature ⇒ COS::Signature
获取鉴权签名方法
32 33 34 |
# File 'lib/cos/client.rb', line 32 def signature api.http.signature end |