1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/lib/fog/aws/parsers/elasticache/subnet_group_parser.rb

36 lines
1.1 KiB
Ruby
Raw Normal View History

module Fog
module Parsers
module AWS
module Elasticache
class SubnetGroupParser < Fog::Parsers::Base
def reset
@cache_subnet_group = fresh_subnet_group
end
def start_element(name, attrs = [])
super
end
def end_element(name)
case name
when 'VpcId' then @cache_subnet_group['VpcId'] = value
when 'SubnetGroupStatus' then @cache_subnet_group['SubnetGroupStatus'] = value
when 'CacheSubnetGroupDescription' then @cache_subnet_group['CacheSubnetGroupDescription'] = value
when 'CacheSubnetGroupName' then @cache_subnet_group['CacheSubnetGroupName'] = value
when 'SubnetIdentifier' then @cache_subnet_group['Subnets'] << value
when 'Marker'
@response['DescribeCacheSubnetGroupsResult']['Marker'] = value
when 'RequestId'
@response['ResponseMetadata'][name] = value
end
end
def fresh_subnet_group
{'Subnets' => []}
end
end
end
end
end
end