Sha256: 6035905f8db6b12d2afed5d365961cee4762d724a641530b68e39d544825fc0b

Contents?: true

Size: 882 Bytes

Versions: 5

Compression:

Stored size: 882 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 whois.centralnic.com record.
      #
      # @since  2.3.0
      class WhoisCentralnicCom < Base

        self.tokenizers += [
            :skip_empty_line,
            :scan_available,
            :scan_disclaimer,
            :scan_keyvalue,
        ]


        tokenizer :scan_available do
          if @input.skip(/^DOMAIN NOT FOUND\n/)
            @ast["status:available"] = true
          end
        end

        tokenizer :scan_disclaimer do
          if @input.match?(/^\S([^:]+)\n/)
            @ast["field:disclaimer"] = _scan_lines_to_array(/(.+)\n/).join(" ")
          end
        end

      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
whois-3.1.3 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.1.2 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.1.1 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.1.0 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.0.0 lib/whois/record/scanners/whois.centralnic.com.rb