2010-04-16 03:20:02 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
|
|
|
module Terremark
|
|
|
|
module Shared
|
|
|
|
|
2013-02-12 07:52:46 -05:00
|
|
|
class GetOrganizations < TerremarkParser
|
|
|
|
# include Fog::Terremark::Shared::Parser
|
2010-04-16 03:20:02 -04:00
|
|
|
|
|
|
|
def reset
|
|
|
|
@response = { 'OrgList' => [] }
|
|
|
|
end
|
|
|
|
|
|
|
|
def start_element(name, attributes)
|
2010-05-05 16:39:41 -04:00
|
|
|
super
|
2010-04-16 03:20:02 -04:00
|
|
|
if name == 'Org'
|
2013-02-12 07:52:46 -05:00
|
|
|
organization = extract_attributes(attributes)
|
2010-04-16 03:20:02 -04:00
|
|
|
until attributes.empty?
|
2010-12-07 19:37:43 -05:00
|
|
|
if attributes.first.is_a?(Array)
|
|
|
|
attribute = attributes.shift
|
|
|
|
organization[attribute.first] = attribute.last
|
|
|
|
else
|
|
|
|
organization[attributes.shift] = attributes.shift
|
|
|
|
end
|
2010-04-16 03:20:02 -04:00
|
|
|
end
|
|
|
|
@response['OrgList'] << organization
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|