class Whois::Record::Parser::WhoisNicIt
Parser for the whois.nic.it server.
Public Instance Methods
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