Class: Whois::Server::Adapters::Arin

Inherits:
Base
  • Object
show all
Defined in:
lib/whois/server/adapters/arin.rb

Overview

Arin Adapter

Provides ability to query Arin WHOIS interfaces.

Constant Summary

Constants inherited from Base

Base::DEFAULT_BIND_HOST, Base::DEFAULT_WHOIS_PORT

Instance Attribute Summary

Attributes inherited from Base

#allocation, #buffer, #host, #options, #type

Instance Method Summary collapse

Methods inherited from Base

#==, #configure, #initialize, #lookup, #query_handler

Constructor Details

This class inherits a constructor from Whois::Server::Adapters::Base

Instance Method Details

#request(string) ⇒ void

This method returns an undefined value.

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

Parameters:

  • string (String)


28
29
30
31
32
33
34
35
36
# File 'lib/whois/server/adapters/arin.rb', line 28

def request(string)
  response = query_the_socket("n + #{string}", host)
  buffer_append response, host

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