Module: AWS::S3::ACLObject
- Included in:
- AccessControlList, AWS::S3::AccessControlList::Grant, AWS::S3::AccessControlList::Grantee, AWS::S3::AccessControlList::Owner, AWS::S3::AccessControlList::Permission
- Defined in:
- lib/aws/s3/acl_object.rb
Overview
Common methods for AccessControlList and related objects.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #body_xml ⇒ Object
- #element_name ⇒ Object
- #initialize(opts = {}) ⇒ Object
- #stag ⇒ Object
-
#to_s ⇒ Object
Returns the XML representation of the object.
-
#to_xml ⇒ Object
Returns the XML representation of the object.
-
#valid? ⇒ Boolean
Returns true if and only if this object is valid according to S3’s published ACL schema.
-
#validate! ⇒ Object
Raises an exception unless this object is valid according to S3’s published ACL schema.
- #validate_input(name, value, context = nil) ⇒ Object
Class Method Details
.included(m) ⇒ Object
258 259 260 |
# File 'lib/aws/s3/acl_object.rb', line 258 def self.included(m) m.extend(ClassMethods) end |
Instance Method Details
#body_xml ⇒ Object
26 |
# File 'lib/aws/s3/acl_object.rb', line 26 def body_xml; ""; end |
#element_name ⇒ Object
34 35 36 |
# File 'lib/aws/s3/acl_object.rb', line 34 def element_name self.class.name[/::([^:]*)$/, 1] end |
#initialize(opts = {}) ⇒ Object
23 |
# File 'lib/aws/s3/acl_object.rb', line 23 def initialize(opts = {}); end |
#stag ⇒ Object
29 30 31 |
# File 'lib/aws/s3/acl_object.rb', line 29 def stag element_name end |
#to_s ⇒ Object
Returns the XML representation of the object. Generally you’ll want to call this on an AccessControlList object, which will yield an XML representation of the ACL that you can send to S3.
42 43 44 45 46 47 48 |
# File 'lib/aws/s3/acl_object.rb', line 42 def to_s if body_xml.empty? "<#{stag}/>" else "<#{stag}>#{body_xml}</#{element_name}>" end end |
#to_xml ⇒ Object
Returns the XML representation of the object. Generally you’ll want to call this on an AccessControlList object, which will yield an XML representation of the ACL that you can send to S3.
51 52 53 |
# File 'lib/aws/s3/acl_object.rb', line 51 def to_xml to_s end |
#valid? ⇒ Boolean
Returns true if and only if this object is valid according to S3’s published ACL schema. In particular, this will check that all required attributes are provided and that they are of the correct type.
59 60 61 62 63 64 65 |
# File 'lib/aws/s3/acl_object.rb', line 59 def valid? validate! rescue => e false else true end |
#validate! ⇒ Object
Raises an exception unless this object is valid according to S3’s published ACL schema.
70 |
# File 'lib/aws/s3/acl_object.rb', line 70 def validate!; end |
#validate_input(name, value, context = nil) ⇒ Object
73 74 75 |
# File 'lib/aws/s3/acl_object.rb', line 73 def validate_input(name, value, context = nil) send("validate_#{name}_input!", value, context) end |