Module: AWS::S3::ACL::S3Object
- Defined in:
- lib/aws/s3/acl.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(klass) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#acl(reload = false) ⇒ Object
The acl method returns and updates the acl for a given s3 object.
Class Method Details
.included(klass) ⇒ Object
:nodoc:
534 535 536 |
# File 'lib/aws/s3/acl.rb', line 534 def self.included(klass) #:nodoc: klass.extend(ClassMethods) end |
Instance Method Details
#acl(reload = false) ⇒ Object
The acl method returns and updates the acl for a given s3 object.
# Fetch a the object
object = S3Object.find 'kiss.jpg', 'marcel'
# Add a grant to the object's
object.acl.grants << some_grant
# Write the changes to the policy
object.acl(object.acl)
575 576 577 578 579 580 581 |
# File 'lib/aws/s3/acl.rb', line 575 def acl(reload = false) policy = reload.is_a?(ACL::Policy) ? reload : nil memoize(reload) do self.class.acl(key, bucket.name, policy) if policy self.class.acl(key, bucket.name) end end |