2010-04-16 03:20:02 -04:00
|
|
|
|
2013-02-12 07:43:18 -05:00
|
|
|
class TerremarkParser < Fog::Parsers::Base
|
2010-04-16 03:20:02 -04:00
|
|
|
|
2013-02-12 07:43:18 -05:00
|
|
|
def extract_attributes(attributes_xml)
|
|
|
|
attributes = {}
|
|
|
|
until attributes_xml.empty?
|
|
|
|
if attributes_xml.first.is_a?(Array)
|
|
|
|
until attributes_xml.first.empty?
|
|
|
|
attribute = attributes_xml.first.shift
|
|
|
|
attributes[attribute.localname] = attribute.value
|
|
|
|
end
|
|
|
|
else
|
|
|
|
attribute = attributes_xml.shift
|
|
|
|
attributes[attribute.localname] = attribute.value
|
2010-04-16 03:20:02 -04:00
|
|
|
end
|
|
|
|
end
|
2013-02-12 07:43:18 -05:00
|
|
|
attributes
|
2010-04-16 03:20:02 -04:00
|
|
|
end
|
|
|
|
end
|
2013-02-12 07:43:18 -05:00
|
|
|
|