Class Whois::Client
In: lib/whois/client.rb
Parent: Object

Methods

new   query  

Constants

DEFAULT_TIMEOUT = 10   The Integer maximum time to run a whois query, expressed in seconds.

Attributes

timeout  [RW] 

Public Class methods

Initializes a new Whois::Client with options.

  new { |client| ... } => client
  new(options = {}) { |client| ... } => client

Parameters

options:Hash of options (default: {}): :timeout - The Integer script timeout, expressed in seconds (default: DEFAULT_TIMEOUT).

If block is given, yields self.

Returns

Whois::Client:The client instance.

Examples

  client = Whois::Client.new do |c|
    c.timeout = nil
  end
  client.query("google.com")

Public Instance methods

Queries the right WHOIS server for qstring and returns the response from the server.

Parameters

qstring:The String to be sent as query parameter.

Returns

Whois::Answer:The answer object containing the WHOIS response.

Examples

  client.query("google.com")
  # => #<Whois::Answer>

[Validate]