Sha256: a5fe25399d26a3246fbe93f7844b9db5289d097998baebfc11122347e01fffca

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

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


require_relative 'base_icann_compliant'


module Whois
  class Parsers

    # Parser for the whois.donuts.com server.
    #
    # @see Whois::Parsers::Example
    #   The Example parser for the list of all available methods.
    #
    class WhoisDonutsCo < BaseIcannCompliant
      self.scanner = Scanners::BaseIcannCompliant, {
          pattern_available: /^Domain not found\.\n/
      }


      property_supported :domain_id do
        node('Domain ID')
      end


      property_supported :expires_on do
        node('Registry Expiry Date') do |value|
          parse_time(value)
        end
      end


      property_supported :registrar do
        return unless node('Sponsoring Registrar')
        Parser::Registrar.new(
            id:           node('Sponsoring Registrar IANA ID'),
            name:         node('Sponsoring Registrar'),
            organization: node('Sponsoring Registrar')
        )
      end


      private

      def build_contact(element, type)
        if (contact = super)
          contact.id = node("#{element} ID")
        end
        contact
      end

    end

  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
hetzner-whois-parser-1.0.1.rc2 lib/whois/parsers/whois.donuts.co.rb
hetzner-whois-parser-1.0.1.rc1 lib/whois/parsers/whois.donuts.co.rb
whois-parser-1.0.0 lib/whois/parsers/whois.donuts.co.rb
whois-parser-1.0.0.pre.beta2 lib/whois/parsers/whois.donuts.co.rb
whois-parser-1.0.0.pre.beta1 lib/whois/parsers/whois.donuts.co.rb