class Whois::Record::Parser::WhoisNicIt

Parser for the whois.nic.it server.

Public Instance Methods

response_unavailable?() click to toggle source

Checks whether this response contains a message that can be reconducted to a “WHOIS Server Unavailable” status.

@return [Boolean]

# File lib/whois/record/parser/whois.nic.it.rb, line 130
def response_unavailable?
  !!node("response:unavailable")
end
unavailable?() click to toggle source

NEWPROPERTY

# File lib/whois/record/parser/whois.nic.it.rb, line 77
def unavailable?
  status == :unavailable
end

Private Instance Methods

build_contact(element, type) click to toggle source
# File lib/whois/record/parser/whois.nic.it.rb, line 137
def build_contact(element, type)
  node(element) do |str|
    address = (str["Address"] || "").split("\n")
    company = address.size == 6 ? address.shift : nil
    Record::Contact.new(
      :id           => str["ContactID"],
      :type         => type,
      :name         => str["Name"],
      :organization => str["Organization"] || company,
      :address      => address[0],
      :city         => address[1],
      :zip          => address[2],
      :state        => address[3],
      :country_code => address[4],
      :created_on   => str["Created"] ? Time.parse(str["Created"]) : nil,
      :updated_on   => str["Last Update"] ? Time.parse(str["Last Update"]) : nil
    )
  end
end