Sha256: a167db9f28d2785c677d490fbe2b52d874ce4f57204eef5467326b347ac4722f

Contents?: true

Size: 1.17 KB

Versions: 32

Compression:

Stored size: 1.17 KB

Contents

module Fog
  module Parsers
    module DNS
      module AWS
        class GetHostedZone < Fog::Parsers::Base
          def reset
            @hosted_zone = {}
            @name_servers = []
            @response = {}
            @section = :hosted_zone
          end

          def end_element(name)
            if @section == :hosted_zone
              case name
              when 'Id'
                @hosted_zone[name]= value.sub('/hostedzone/', '')
              when 'Name', 'CallerReference', 'Comment'
                @hosted_zone[name]= value
              when 'HostedZone'
                @response['HostedZone'] = @hosted_zone
                @hosted_zone = {}
                @section = :name_servers
              when 'ResourceRecordSetCount'
                @response['ResourceRecordSetCount'] = value.to_i
              end
            elsif @section == :name_servers
              case name
              when 'NameServer'
                @name_servers << value
              when 'NameServers'
                @response['NameServers'] = @name_servers
                @name_servers = {}
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 5 rubygems

Version Path
fog-aws-0.7.3 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.7.2 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.6.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.5.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.4.1 lib/fog/aws/parsers/dns/get_hosted_zone.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.4.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.3.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.2.2 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.2.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.1.2 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.1.1 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.1.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.0.8 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.0.7 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.0.6 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-aws-0.0.5 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-1.26.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-1.25.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
nsidc-fog-1.24.1 lib/fog/aws/parsers/dns/get_hosted_zone.rb