Sha256: 481b005e7652a9888a37a4ff25f933638e5eb5987a79bcda1531d1c451aabd44

Contents?: true

Size: 1.24 KB

Versions: 79

Compression:

Stored size: 1.24 KB

Contents

module Fog
  module Parsers
    module Compute
      module AWS

        class CreateSubnet < 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 'subnet'
                @response['subnetSet'] << @subnet
                @subnet = { 'tagSet' => {} }
              when 'requestId'
                @response[name] = value
              end
            end
          end
        end
      end
    end
  end
end


Version data entries

79 entries across 79 versions & 14 rubygems

Version Path
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/parsers/compute/create_subnet.rb
fog-1.19.0 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/aws/parsers/compute/create_subnet.rb