Sha256: 46aeaf516a81a75ed64a4eeea4daf04ba162de5ef55bb7a9c0640f9ec2c6d734

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

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

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
fog-1.22.0 lib/fog/aws/parsers/elasticache/subnet_group_parser.rb
fog-1.21.0 lib/fog/aws/parsers/elasticache/subnet_group_parser.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/parsers/elasticache/subnet_group_parser.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/parsers/elasticache/subnet_group_parser.rb
fog-1.20.0 lib/fog/aws/parsers/elasticache/subnet_group_parser.rb