Sha256: 66d9a744d956f09e36a4c4d3843a63701df0e2ca9afe5d1aad2daa9a0969de0a

Contents?: true

Size: 1.19 KB

Versions: 5

Compression:

Stored size: 1.19 KB

Contents

module Fog
  module Parsers
    module Compute
      module AWS

        class CreateSubnet < Fog::Parsers::Base

          def reset
            @subnet = { 'tagSet' => {} }
            @response = { 'subnet' => [] }
            @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['subnet'] = @subnet
              when 'requestId'
                @response[name] = value
              end
            end
          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/compute/create_subnet.rb
fog-1.21.0 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/parsers/compute/create_subnet.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/parsers/compute/create_subnet.rb
fog-1.20.0 lib/fog/aws/parsers/compute/create_subnet.rb