Sha256: 208f9c0ac6139e5789000fd7169bc7b33d124a3cc3fbe66f615bea7ed7505db2

Contents?: true

Size: 1.43 KB

Versions: 13

Compression:

Stored size: 1.43 KB

Contents

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


require 'whois/record/parser/base_icann_compliant'


module Whois
  class Record
    class Parser

      # Parser for the whois.donuts.com server.
      #
      # @see Whois::Record::Parser::Example
      #   The Example parser for the list of all available methods.
      #
      class WhoisUniregistryNet < BaseIcannCompliant
        self.scanner = Scanners::BaseIcannCompliant, {
            pattern_available: />>> Domain \".+\" is available/
        }


        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')
          Record::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

        def parse_time(value)
          Time.parse(value).change(usec: 0)
        end

      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
whois-3.6.2 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.6.1 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.6.0 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.9 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.8 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.7 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.6 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.5 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.4 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.3 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.2 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.1 lib/whois/record/parser/whois.uniregistry.net.rb
whois-3.5.0 lib/whois/record/parser/whois.uniregistry.net.rb