Sha256: 543f861505ec7fdf2751c2880d739905b2fe641fe316b709c9b1f4bdc62ac1ec

Contents?: true

Size: 852 Bytes

Versions: 8

Compression:

Stored size: 852 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.
      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

8 entries across 8 versions & 1 rubygems

Version Path
whois-3.4.3 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.4.2 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.4.1 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.4.0 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.3.1 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.3.0 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.2.1 lib/whois/record/scanners/whois.centralnic.com.rb
whois-3.2.0 lib/whois/record/scanners/whois.centralnic.com.rb