class Whois::Parsers::WhoisIanaOrg

Parser for the whois.iana.org server.

Private Instance Methods

build_contact(element, type) click to toggle source
# File lib/whois/parsers/whois.iana.org.rb, line 79
def build_contact(element, type)
  node(element) do |raw|
    if raw["organisation"] != "Not assigned"
      address = (raw["address"] || "").split("\n")
      Parser::Contact.new(
        :type         => type,
        :name         => raw["name"],
        :organization => raw["organisation"],
        :address      => address[0],
        :city         => address[1],
        :zip          => address[2],
        :country      => address[3],
        :phone        => raw["phone"],
        :fax          => raw["fax-no"],
        :email        => raw["e-mail"]
      )
    end
  end
end