Sha256: 9a0a0da4fce2a1359bd3dd71be4e1bb6e1debfcc0d4f9f777c5a4e5452f154c0
Contents?: true
Size: 1.06 KB
Versions: 16
Compression:
Stored size: 1.06 KB
Contents
module Fog module Parsers module Terremark class GetCatalog < Fog::Parsers::Base def reset @response = { 'CatalogItems' => [] } end def start_element(name, attributes) @value = '' case name when 'CatalogItem' catalog_item = {} until attributes.empty? catalog_item[attributes.shift] = attributes.shift end @response['CatalogItems'] << catalog_item when 'Catalog' catalog = {} until attributes.empty? if attributes.first.is_a?(Array) attribute = attributes.shift catalog[attribute.first] = attribute.last else catalog[attributes.shift] = attributes.shift end end @response['name'] = catalog['name'] end end def end_element(name) if name == 'Description' @response[name] = @value end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems