Class: RAWS::S3::ACL::ID

Inherits:
Grant
  • Object
show all
Defined in:
lib/raws/s3/acl.rb

Instance Attribute Summary collapse

Attributes inherited from Grant

#permission

Instance Method Summary collapse

Constructor Details

#initialize(id, permission, name = nil) ⇒ ID

Returns a new instance of ID.



34
35
36
37
# File 'lib/raws/s3/acl.rb', line 34

def initialize(id, permission, name=nil)
  super(permission)
  @id, @name = id, name
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



32
33
34
# File 'lib/raws/s3/acl.rb', line 32

def id
  @id
end

#nameObject

Returns the value of attribute name.



32
33
34
# File 'lib/raws/s3/acl.rb', line 32

def name
  @name
end

Instance Method Details

#to_xmlObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/raws/s3/acl.rb', line 39

def to_xml
  '<Grant>' <<
    '<Grantee' <<
    ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' <<
    ' xsi:type="CanonicalUser">' <<
      "<ID>#{@id}</ID>" <<
      (@name ? "<DisplayName>#{@name}</DisplayName>" : '') <<
    '</Grantee>' <<
    super <<
  '</Grant>'
end