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-1.24.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.11 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.10 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.9 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.8 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.7 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.6 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-1.23.0 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.4 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.3 lib/fog/aws/parsers/dns/get_hosted_zone.rb
ns-fog-1.22.2 lib/fog/aws/parsers/dns/get_hosted_zone.rb
fog-1.22.1 lib/fog/aws/parsers/dns/get_hosted_zone.rb