Sha256: 683991403b07084a15c830204d82de3f9c95ca4c73446c8903f4ee989481eb8f

Contents?: true

Size: 1.92 KB

Versions: 2

Compression:

Stored size: 1.92 KB

Contents

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


require_relative 'base'
require 'whois/scanners/whois.cctld.by.rb'


module Whois
  class Parsers

    # Parser for the whois.cctld.by server.
    #
    # @see Whois::Parsers::Example
    #   The Example parser for the list of all available methods.
    #
    # @author Aliaksei Kliuchnikau <aliaksei.kliuchnikau@gmail.com>
    class WhoisCctldBy < Base
      include Scanners::Scannable

      self.scanner = Scanners::WhoisCctldBy


      property_not_supported :disclaimer


      property_supported :domain do
        node("Domain Name", &:downcase)
      end

      property_not_supported :domain_id


      property_supported :status do
        if available?
          :available
        else
          :registered
        end
      end

      property_supported :available? do
        !!node("status:available")
      end

      property_supported :registered? do
        !available?
      end


      property_supported :created_on do
        node("Creation Date") { |value| parse_time(value) }
      end

      property_supported :updated_on do
        node("Updated Date") { |value| parse_time(value) }
      end

      property_supported :expires_on do
        node("Expiration Date") { |value| parse_time(value) }
      end


      property_supported :registrar do
        node("Registrar") do |registrar|
          Parser::Registrar.new(
            :id => registrar,
            :name => registrar,
            :organization => registrar
          )
        end
      end

      property_not_supported :registrant_contacts

      property_not_supported :admin_contacts

      property_not_supported :technical_contacts


      property_supported :nameservers do
        Array.wrap(node("Name Server")).map do |name|
          Parser::Nameserver.new(:name => name.downcase)
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whois-parser-1.2.0 lib/whois/parsers/whois.cctld.by.rb
whois-parser-1.1.0 lib/whois/parsers/whois.cctld.by.rb