Sha256: f9db3f6a15535e3135734b928868c238e4ff26b6bd512b458b06c163c0b5678b
Contents?: true
Size: 1.34 KB
Versions: 43
Compression:
Stored size: 1.34 KB
Contents
module Fog module Parsers module Compute module AWS class DescribeSubnets < Fog::Parsers::Base def reset @subnet = { 'tagSet' => {} } @response = { 'subnetSet' => [] } @tag = {} end def start_element(name, attrs = []) super case name when 'tagSet' @in_tag_set = true end end def end_element(name) if @in_tag_set case name when 'item' @subnet['tagSet'][@tag['key']] = @tag['value'] @tag = {} when 'key', 'value' @tag[name] = value when 'tagSet' @in_tag_set = false end else case name when 'subnetId', 'state', 'vpcId', 'cidrBlock', 'availableIpAddressCount', 'availabilityZone' @subnet[name] = value when 'mapPublicIpOnLaunch' @subnet[name] = value == 'true' ? true : false when 'item' @response['subnetSet'] << @subnet @subnet = { 'tagSet' => {} } when 'requestId' @response[name] = value end end end end end end end end
Version data entries
43 entries across 43 versions & 4 rubygems