Sha256: d0d1afd9a5f33d45a17e47588770d6f8a6566a2d52d52b88f46ea304fd73e08a

Contents?: true

Size: 903 Bytes

Versions: 2

Compression:

Stored size: 903 Bytes

Contents

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


require 'whois/record/parser/scanners/base'


module Whois
  class Record
    class Parser
      module Scanners

        # Scanner for the whois.cnnic.cn record.
        class WhoisCnnicCn < Base

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


          tokenizer :scan_available do
            if @input.scan(/^no matching record/)
              @ast["status:available"] = true
            end
          end

          tokenizer :scan_reserved do
            if @input.scan(/^the domain you want to register is reserved/)
              @ast["status:reserved"] = true
            end
          end

        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whois-2.4.0 lib/whois/record/parser/scanners/whois.cnnic.cn.rb
whois-2.3.0 lib/whois/record/parser/scanners/whois.cnnic.cn.rb