Class: Fog::Parsers::Terremark::GetOrganizations

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/terremark/parsers/get_organizations.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#characters, #initialize

Constructor Details

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

Instance Method Details

#resetObject



7
8
9
# File 'lib/fog/terremark/parsers/get_organizations.rb', line 7

def reset
  @response = { 'OrgList' => [] }
end

#start_element(name, attributes) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/fog/terremark/parsers/get_organizations.rb', line 11

def start_element(name, attributes)
  @value = ''
  if name == 'Org'
    organization = {}
    until attributes.empty?
      organization[attributes.shift] = attributes.shift
    end
    @response['OrgList'] << organization
  end
end