Sha256: 81b292e29f7efee5f36ab7f005ee9c6f3b38c97e770d9325e3c908cb7e7c502d

Contents?: true

Size: 928 Bytes

Versions: 1

Compression:

Stored size: 928 Bytes

Contents

#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2013 Simone Carletti <weppos@weppos.net>
#++


require 'whois/record/scanners/base'


module Whois
  class Record
    module Scanners

      # Scanner for the Icann Compliant-based records.
      class BaseIcannCompliant < Base

        self.tokenizers += [
            :scan_available,
            :skip_head,
            :scan_keyvalue,
            :skip_end,
        ]


        tokenizer :scan_available do
          if @input.skip(/^Domain not found\.\n/)
            @ast['status:available'] = true
          end
        end

        tokenizer :skip_head do
          if @input.skip_until(/^Domain Name:/)
            @input.scan(/\s(.+)\n/)
            @ast['domain:name'] = @input[1].strip
          end
        end

        tokenizer :skip_end do
          @input.skip_until(/.*$/m)
        end

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whois-3.3.1 lib/whois/record/scanners/base_icann_compliant.rb