In Files

Files

Class/Module Index [+]

Quicksearch

Whois

Constants

AUTHORS
GEM
NAME
VERSION

The current library version.

Public Class Methods

available?(object) click to toggle source

Checks whether the object represented by object is available.

Warning: this method is only available if a Whois parser exists for the top level domain of object. If no parser exists for object, you'll receive a warning message and the method will return nil. This is a technical limitation. Browse the lib/whois/record/parsers folder to view all available parsers.

@param [String] object The string to be sent as query parameter.

It is intended to be a domain name, otherwise this method
may return unexpected responses.

@return [Boolean]

@example

Whois.available?("google.com")
# => false

@example

Whois.available?("google-is-not-available-try-again-later.com")
# => true
# File lib/whois.rb, line 69
def available?(object)
  result = query(object).available?
  if result.nil?
    warn  "This method is not supported for this kind of object.\n" +
          "Use Whois.query('#{object}') instead."
  end
  result
end
bug!(error, message) click to toggle source

Appends Please report issue to to the message and raises a new error with the final message.

@param [Exception] error @param [String] message @return [void]

@api private @private

# File lib/whois.rb, line 132
def bug!(error, message)
  raise error, message.dup        <<
    " Please report the issue at" <<
    " http://github.com/weppos/whois/issues"
end
deprecate(message = nil, callstack = caller) click to toggle source

Echoes a deprecation warning message.

@param [String] message The message to display. @return [void]

@api private @private

# File lib/whois.rb, line 117
def deprecate(message = nil, callstack = caller)
  message ||= "You are using deprecated behavior which will be removed from the next major or minor release."
  # warn("DEPRECATION WARNING: #{message} #{deprecation_caller_message(callstack)}")
  warn("DEPRECATION WARNING: #{message}")
end
query(object) click to toggle source

Queries the WHOIS server for object and returns the response from the server.

@param [String] object The string to be sent as query parameter. @return [Whois::Record] The record containing the response from the WHOIS server.

@example

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

# Equivalent to
Whois::Client.new.lookup("google.com")
# File lib/whois.rb, line 40
def query(object)
  Client.new.lookup(object)
end
Also aliased as: whois
registered?(object) click to toggle source

Checks whether the object represented by object is registered.

Warning: this method is only available if a Whois parser exists for the top level domain of object. If no parser exists for object, you'll receive a warning message and the method will return nil. This is a technical limitation. Browse the lib/whois/record/parsers folder to view all available parsers.

@param [String] object The string to be sent as query parameter.

It is intended to be a domain name, otherwise this method
may return unexpected responses.

@return [Boolean]

@example

Whois.registered?("google.com")
# => true

@example

Whois.registered?("google-is-not-available-try-again-later.com")
# => false
# File lib/whois.rb, line 100
def registered?(object)
  result = query(object).registered?
  if result.nil?
    warn  "This method is not supported for this kind of object.\n" +
          "Use Whois.query('#{object}') instead."
  end
  result
end
whois(object) click to toggle source
Alias for: query

[Validate]

Generated with the Darkfish Rdoc Generator 2.