class Whois::Server::Adapters::Afilias

Afilias Adapter

Provides ability to query Afilias WHOIS interfaces.

Public Instance Methods

request(string) click to toggle source

Executes a WHOIS query to the Afilias WHOIS interface, resolving any intermediate referral, and appends the response to the client buffer.

@param [String] string @return [void]

# File lib/whois/server/adapters/afilias.rb, line 28
def request(string)
  response = query_the_socket(string, host)
  buffer_append response, host

  if options[:referral] != false && referral = extract_referral(response)
    response = query_the_socket(string, referral)
    buffer_append(response, referral)
  end
end

Private Instance Methods

extract_referral(response) click to toggle source
# File lib/whois/server/adapters/afilias.rb, line 41
def extract_referral(response)
  if response =~ /Domain Name:/
    response.slice(/Whois Server:(\S+)/, 1)
  end
end