Sha256: 2db889d67cfaf6053c60e8b794bccc2d087fd99f2e2c97e834aea80f87f7485b

Contents?: true

Size: 1001 Bytes

Versions: 2

Compression:

Stored size: 1001 Bytes

Contents

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


require_relative 'base_icann_compliant'


module Whois
  class Parsers

    # Parser for the whois.safenames.net server.
    #
    # @see Whois::Parsers::Example
    #   The Example parser for the list of all available methods.
    #
    class WhoisSafenamesNet < BaseIcannCompliant
      self.scanner = Scanners::BaseIcannCompliant, {
          pattern_available: /^No match for "[\w\.]+"\.\n/
      }

      property_supported :created_on do
        node('Created Date') do |value|
          parse_time(value)
        end
      end


      private

      def contact_organization_attribute(element)
        value_for_property(element, 'Organisation')
      end

      def contact_address_attribute(element)
        address = (1..2).
          map { |i| node("#{element} Address Line #{i}") }.
          compact.join("\n").chomp
      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.safenames.net.rb
whois-parser-1.1.0 lib/whois/parsers/whois.safenames.net.rb