Sha256: c4bf444676fb456a13131523c31bf4a0c73eab54765e1ddc52b2215f67caef37
Contents?: true
Size: 1.08 KB
Versions: 12
Compression:
Stored size: 1.08 KB
Contents
module Fog module Parsers module Terremark module Shared class InstantiateVappTemplate < Fog::Parsers::Base def reset @property_key @response = { 'Links' => [] } end def start_element(name, attributes) @value = '' case name when 'Link' link = {} until attributes.empty? link[attributes.shift] = attributes.shift end @response['Links'] << link when 'VApp' vapp_template = {} until attributes.empty? if attributes.first.is_a?(Array) attribute = attributes.shift vapp_template[attribute.first] = attribute.last else vapp_template[attributes.shift] = attributes.shift end end @response.merge!(vapp_template.reject {|key, value| !['href', 'name', 'size', 'status', 'type'].include?(key)}) end end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems