Class: Fog::Parsers::Storage::AWS::AccessControlList

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/aws/parsers/storage/access_control_list.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#attr_value, #characters, #end_element_namespace, #initialize, #start_element_namespace, #value

Constructor Details

This class inherits a constructor from Fog::Parsers::Base

Instance Method Details

#end_element(name) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fog/aws/parsers/storage/access_control_list.rb', line 19

def end_element(name)
  case name
  when 'AccessControlList'
    @in_access_control_list = false
  when 'Grant'
    @response['AccessControlList'] << @grant
    @grant = { 'Grantee' => {} }
  when 'DisplayName', 'ID'
    if @in_access_control_list
      @grant['Grantee'][name] = value
    else
      @response['Owner'][name] = value
    end
  when 'Permission'
    @grant[name] = value
  when 'URI'
    @grant['Grantee'][name] = value
  end
end

#resetObject



6
7
8
9
10
# File 'lib/fog/aws/parsers/storage/access_control_list.rb', line 6

def reset
  @in_access_control_list = false
  @grant = { 'Grantee' => {} }
  @response = { 'Owner' => {}, 'AccessControlList' => [] }
end

#start_element(name, attrs = []) ⇒ Object



12
13
14
15
16
17
# File 'lib/fog/aws/parsers/storage/access_control_list.rb', line 12

def start_element(name, attrs = [])
  super
  if name == 'AccessControlList'
    @in_access_control_list = true
  end
end