module MSS::S3::ACLObject

Common methods for AccessControlList and related objects.

Public Class Methods

included(m) click to toggle source
# File lib/mss/s3/acl_object.rb, line 257
def self.included(m)
  m.extend(ClassMethods)
end
new(opts = {}) click to toggle source

@api private

# File lib/mss/s3/acl_object.rb, line 22
def initialize(opts = {}); end

Public Instance Methods

body_xml() click to toggle source

@api private

# File lib/mss/s3/acl_object.rb, line 25
def body_xml; ""; end
element_name() click to toggle source

@api private

# File lib/mss/s3/acl_object.rb, line 33
def element_name
  self.class.name[/::([^:]*)$/, 1]
end
stag() click to toggle source

@api private

# File lib/mss/s3/acl_object.rb, line 28
def stag
  element_name
end
to_s() click to toggle source

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.

# File lib/mss/s3/acl_object.rb, line 41
def to_s
  if body_xml.empty?
    "<#{stag}/>"
  else
    "<#{stag}>#{body_xml}</#{element_name}>"
  end
end
to_xml() click to toggle source

(see to_s)

# File lib/mss/s3/acl_object.rb, line 50
def to_xml
  to_s
end
valid?() click to toggle source

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.

# File lib/mss/s3/acl_object.rb, line 58
def valid?
  validate!
rescue => e
  false
else
  true
end
validate!() click to toggle source

Raises an exception unless this object is valid according to S3's published ACL schema. @see valid?

# File lib/mss/s3/acl_object.rb, line 69
def validate!; end
validate_input(name, value, context = nil) click to toggle source

@api private

# File lib/mss/s3/acl_object.rb, line 72
def validate_input(name, value, context = nil)
  send("validate_#{name}_input!", value, context)
end