Module: AWS::S3::ACL::Bucket
- 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 bucket.
Class Method Details
.included(klass) ⇒ Object
:nodoc:
491 492 493 |
# File 'lib/aws/s3/acl.rb', line 491 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 bucket.
# Fetch a bucket
bucket = Bucket.find 'marcel'
# Add a grant to the bucket's policy
bucket.acl.grants << some_grant
# Write the changes to the policy
bucket.acl(bucket.acl)
529 530 531 532 533 534 535 |
# File 'lib/aws/s3/acl.rb', line 529 def acl(reload = false) policy = reload.is_a?(ACL::Policy) ? reload : nil memoize(reload) do self.class.acl(name, policy) if policy self.class.acl(name) end end |