Class: Fog::Parsers::Storage::InternetArchive::AccessControlList

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

Instance Method Summary collapse

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/parsers/storage/internet_archive/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/parsers/storage/internet_archive/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/parsers/storage/internet_archive/access_control_list.rb', line 12

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