Sha256: 2d65883219fb67b58f26873da1abe21a210bef10bb59f61d1fc762f847fd7e79

Contents?: true

Size: 1.24 KB

Versions: 84

Compression:

Stored size: 1.24 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 'item'
                @response['subnetSet'] << @subnet
                @subnet = { 'tagSet' => {} }
              when 'requestId'
                @response[name] = value
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

84 entries across 84 versions & 14 rubygems

Version Path
fog-1.22.0 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-1.21.0 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-1.20.0 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-1.19.0 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/parsers/compute/describe_subnets.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/parsers/compute/describe_subnets.rb