Class | Whois::Server::Adapters::Base |
In: |
lib/whois/server/adapters/base.rb
|
Parent: | Object |
DEFAULT_WHOIS_PORT | = | 43 | Default WHOIS request port. | |
DEFAULT_BIND_HOST | = | "0.0.0.0" | Default bind hostname. | |
RESCUABLE_CONNECTION_ERRORS | = | [ Errno::ECONNRESET, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, SocketError, ] | Array of connection errors to rescue and wrap into a {Whois::ConnectionError} |
allocation | [R] | @return [String] The allocation this server is responsible for. |
buffer | [R] |
Temporary internal response buffer.
@api internal @return [Array] |
host | [R] | @return [String, nil] The server hostname. |
options | [R] | @return [Hash] Optional adapter properties. |
type | [R] | @return [Symbol] The type of WHOIS server |
@param [Symbol] type
The type of WHOIS adapter to define. Known values are :tld, :ipv4, :ipv6.
@param [String] allocation
The allocation, range or hostname, this server is responsible for.
@param [String, nil] host
The server hostname. Use nil if unknown or not available.
@param [Hash] options Optional adapter properties.
Checks self and other for equality.
@param [The Whois::Server::Adapters::Base] other
@return [Boolean] Returns true if the other is the same object,
or <tt>other</tt> attributes matches this object attributes.
Performs a Whois query for string using the current server adapter.
@param [String] string The string to be sent as query parameter.
@return [Whois::Record]
Internally, this method calls {request} using the Template Method design pattern.
server.query("google.com") # => Whois::Record
Performs the real WHOIS request.
This method is not implemented in {Whois::Server::Adapters::Base} class, it is intended to be overwritten in the concrete subclasses. This is the heart of the Template Method design pattern.
@param [String] string The string to be sent as query parameter.
@raise [NotImplementedError] @return [void] @abstract