mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
35 lines
831 B
Ruby
35 lines
831 B
Ruby
module Fog
|
|
module Parsers
|
|
module TerremarkEcloud
|
|
module Compute
|
|
|
|
class GetOrganization < Fog::Parsers::Base
|
|
|
|
def reset
|
|
@response = { 'Link' => [] }
|
|
end
|
|
|
|
def start_element(name, attrs = [])
|
|
case name
|
|
when 'Link'
|
|
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
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|