Class: Aliyun::Oss::Struct::Object
- Defined in:
- lib/aliyun/oss/struct/object.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
bucket of object placed.
-
#client ⇒ Object
reference to client.
-
#etag ⇒ Object
etag of object.
-
#key ⇒ Object
Key of object.
-
#last_modified ⇒ Object
last modified time of object.
-
#location ⇒ Object
location of object.
-
#owner ⇒ Object
owner of object.
-
#size ⇒ Object
size of object.
-
#storage_class ⇒ Object
storage class of object.
-
#type ⇒ Object
type of object.
Instance Method Summary collapse
-
#acl! ⇒ String
Get ACL for object.
-
#meta!(*args) ⇒ Hash
Get meta information of object.
-
#set_acl(acl) ⇒ true
Set ACL for object.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Aliyun::Oss::Struct::Base
Instance Attribute Details
#bucket ⇒ Object
bucket of object placed
30 31 32 |
# File 'lib/aliyun/oss/struct/object.rb', line 30 def bucket @bucket end |
#client ⇒ Object
reference to client
33 34 35 |
# File 'lib/aliyun/oss/struct/object.rb', line 33 def client @client end |
#etag ⇒ Object
etag of object
12 13 14 |
# File 'lib/aliyun/oss/struct/object.rb', line 12 def etag @etag end |
#last_modified ⇒ Object
last modified time of object
9 10 11 |
# File 'lib/aliyun/oss/struct/object.rb', line 9 def last_modified @last_modified end |
#location ⇒ Object
location of object
27 28 29 |
# File 'lib/aliyun/oss/struct/object.rb', line 27 def location @location end |
#owner ⇒ Object
owner of object
24 25 26 |
# File 'lib/aliyun/oss/struct/object.rb', line 24 def owner @owner end |
#size ⇒ Object
size of object
18 19 20 |
# File 'lib/aliyun/oss/struct/object.rb', line 18 def size @size end |
#storage_class ⇒ Object
storage class of object
21 22 23 |
# File 'lib/aliyun/oss/struct/object.rb', line 21 def storage_class @storage_class end |
#type ⇒ Object
type of object
15 16 17 |
# File 'lib/aliyun/oss/struct/object.rb', line 15 def type @type end |
Instance Method Details
#acl! ⇒ String
Get ACL for object
40 41 42 43 44 |
# File 'lib/aliyun/oss/struct/object.rb', line 40 def acl! result = client.bucket_get_object_acl(key).parsed_response acl_keys = %w(AccessControlPolicy AccessControlList Grant) Utils.dig_value(result, *acl_keys).strip end |
#meta!(*args) ⇒ Hash
Get meta information of object
65 66 67 |
# File 'lib/aliyun/oss/struct/object.rb', line 65 def (*args) client.(*args.unshift(key)).headers end |
#set_acl(acl) ⇒ true
Set ACL for object
53 54 55 |
# File 'lib/aliyun/oss/struct/object.rb', line 53 def set_acl(acl) !!client.bucket_set_object_acl(key, acl) end |