class Whois::Parsers::BaseShared2

Shared parser 2.

@abstract

Private Instance Methods

build_contact(element, type) click to toggle source
# File lib/whois/parsers/base_shared2.rb, line 99
def build_contact(element, type)
  node("#{element} ID") do |str|
    address = (1..3).
        map { |i| node("#{element} Address#{i}") }.
        delete_if(&:nil?).
        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      => node("#{element} Country"),
      :country_code => node("#{element} Country Code"),
      :phone        => node("#{element} Phone Number"),
      :fax          => node("#{element} Facsimile Number"),
      :email        => node("#{element} Email")
    )
  end
end