2011-01-08 23:53:54 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
|
|
|
module TerremarkEcloud
|
|
|
|
module Compute
|
|
|
|
|
|
|
|
class GetOrganization < Fog::Parsers::Base
|
|
|
|
|
|
|
|
def reset
|
2011-01-20 16:28:28 -08:00
|
|
|
@response = { 'Link' => [] }
|
2011-01-08 23:53:54 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def start_element(name, attrs = [])
|
|
|
|
case name
|
|
|
|
when 'Link'
|
2011-01-20 16:28:28 -08:00
|
|
|
link = {}
|
|
|
|
for attribute in %w{href name rel type}
|
|
|
|
if value = attr_value(attribute, attrs)
|
|
|
|
link[attribute] = value
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@response['Link'] << link
|
|
|
|
when 'Org'
|
|
|
|
for attribute in %w{href name}
|
|
|
|
if value = attr_value(attribute, attrs)
|
|
|
|
@response[attribute] = value
|
|
|
|
end
|
2011-01-08 23:53:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|