Class: Whois::Parsers::WhoisPirOrg

Inherits:
BaseAfilias show all
Defined in:
lib/whois/parsers/whois.pir.org.rb

Overview

Parser for the whois.pir.org server.

Instance Attribute Summary

Attributes inherited from Base

#part

Instance Method Summary collapse

Methods included from Scanners::Scannable

included, #node, #node?, #parse

Methods inherited from Base

#changed?, #contacts, #content, #initialize, #is, parse_time, property_not_implemented, property_not_supported, property_register, property_state, property_state?, property_supported, #property_supported?, #response_incomplete?, #response_unavailable?, #unchanged?, #validate!

Constructor Details

This class inherits a constructor from Whois::Parsers::Base

Instance Method Details

#build_contact(element, type) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/whois/parsers/whois.pir.org.rb', line 63

def build_contact(element, type)
  node("#{element} ID") do
    address = [node("#{element} Street")]
    address = (address + (1..3).map { |i| node("#{element} Street#{i}") }).
      delete_if { |i| i.nil? || i.empty? }.
      join("\n")

    Parser::Contact.new(
        :type         => type,
        :id           => node("#{element} ID"),
        :name         => node("#{element} Name"),
        :organization => node("#{element} Organization"),
        :address      => address,
        :city         => node("#{element} City"),
        :zip          => node("#{element} Postal Code"),
        :state        => node("#{element} State/Province"),
        :country_code => node("#{element} Country"),
        :phone        => node("#{element} Phone"),
        :fax          => node("#{element} Fax"),
        :email        => node("#{element} Email")
    )
  end
end

#response_throttled?Boolean

Checks whether the response has been throttled.

Examples:

WHOIS LIMIT EXCEEDED - SEE WWW.PIR.ORG/WHOIS FOR DETAILS

Returns:

  • (Boolean)


28
29
30
# File 'lib/whois/parsers/whois.pir.org.rb', line 28

def response_throttled?
  !!node("response:throttled")
end