Sha256: cabab6c29de4d815ad6beed9b4f8607867ac88f6fbf48f320208a28bfdea45d2

Contents?: true

Size: 1.87 KB

Versions: 5

Compression:

Stored size: 1.87 KB

Contents

#
# = Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
#
# Category::    Net
# Package::     Whois
# Author::      Simone Carletti <weppos@weppos.net>
# License::     MIT License
#
#--
#
#++


require 'whois/answer/parser/base'
require 'whois/answer/parser/scanners/verisign'


module Whois
  class Answer
    class Parser

      #
      # = whois.nic.cc parser
      #
      # Parser for the whois.nic.cc server.
      #
      class WhoisNicCc < Base
        include Ast

        property_supported :disclaimer do
          node("Disclaimer")
        end


        property_supported :domain do
          node("Domain Name") { |raw| raw.downcase }
        end

        property_supported :domain_id do
          nil
        end


        property_supported :referral_whois do
          node("Whois Server")
        end

        property_supported :referral_url do
          node("Referral URL")
        end


        property_supported :status do
          node("Status")
        end

        property_supported :available? do
          node("Registrar").nil?
        end

        property_supported :registered? do
          !available?
        end


        property_supported :created_on do
          node("Creation Date") { |raw| Time.parse(raw) }
        end

        property_supported :updated_on do
          node("Updated Date") { |raw| Time.parse(raw) }
        end

        property_supported :expires_on do
          node("Expiration Date") { |raw| Time.parse(raw) }
        end


        property_supported :registrar do
          # Return nil because when the response contains more than one registrar section
          # the response can be messy. See, for instance, the Verisign response for google.com.
          nil
        end


        protected

          def parse
            Scanners::VerisignScanner.new(content_for_scanner).parse
          end

      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
whois-1.0.5 lib/whois/answer/parser/whois.nic.cc.rb
whois-1.0.4 lib/whois/answer/parser/whois.nic.cc.rb
whois-1.0.3 lib/whois/answer/parser/whois.nic.cc.rb
whois-1.0.2 lib/whois/answer/parser/whois.nic.cc.rb
whois-1.0.1 lib/whois/answer/parser/whois.nic.cc.rb