Class: AWS::S3::ACL::Policy::Builder
- Inherits:
-
XmlGenerator
- Object
- String
- XmlGenerator
- AWS::S3::ACL::Policy::Builder
- Defined in:
- lib/aws/s3/acl.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#grants ⇒ Object
readonly
Returns the value of attribute grants.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
Attributes inherited from XmlGenerator
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(owner, grants) ⇒ Builder
constructor
A new instance of Builder.
Methods inherited from String
#previous, #previous!, #remove_extended, #remove_extended!, #tap, #to_header, #underscore, #valid_utf8?
Constructor Details
#initialize(owner, grants) ⇒ Builder
Returns a new instance of Builder.
182 183 184 185 186 |
# File 'lib/aws/s3/acl.rb', line 182 def initialize(owner, grants) @owner = owner @grants = grants.uniq # There could be some duplicate grants super() end |
Instance Attribute Details
#grants ⇒ Object (readonly)
Returns the value of attribute grants.
181 182 183 |
# File 'lib/aws/s3/acl.rb', line 181 def grants @grants end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
181 182 183 |
# File 'lib/aws/s3/acl.rb', line 181 def owner @owner end |
Instance Method Details
#build ⇒ Object
188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/aws/s3/acl.rb', line 188 def build xml.tag!('AccessControlPolicy', 'xmlns' => 'http://s3.amazonaws.com/doc/2006-03-01/') do xml.Owner do xml.ID owner.id xml.DisplayName owner.display_name end xml.AccessControlList do xml << grants.map {|grant| grant.to_xml}.join("\n") end end end |