Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

YARDOC

  • Loading branch information...
commit 0d5cd22e66fd5f274f4639304b36e85a1ee901b2 1 parent 5fe1c3f
Simone Carletti authored
2  lib/whois.rb
View
@@ -126,7 +126,7 @@ def self.deprecate(message = nil)
warn("DEPRECATION WARNING: #{message}")
end
- # Appends "Please report issue to" to the message
+ # Appends <em>Please report issue to</em> to the message
# and raises a new +error+ with the final message.
#
# @param [Exception] error
25 lib/whois/answer.rb
View
@@ -49,15 +49,15 @@ def to_s
# Returns a human-readable representation of this answer.
#
- # @return [String] The result of #inspect on content.
+ # @return [String] The result of {#inspect} on content.
def inspect
content.inspect
end
- # Invokes <tt>match</tt> on answer <tt>@content</tt>
+ # Invokes {#match} on answer {#content}
# and returns the match as <tt>MatchData</tt> or <tt>nil</tt>.
#
- # @param [RegExp, String] match
+ # @param [Regexp, String] match
# @return [MatchData] If pattern matches #content
# @return [nil] If pattern doesn't match #content
#
@@ -67,10 +67,10 @@ def match(pattern)
content.match(pattern)
end
- # Invokes <tt>match</tt> and returns <tt>true</tt> if <tt>pattern</tt>
- # matches <tt>@content</tt>, <tt>false</tt> otherwise.
+ # Invokes {#match} and returns <tt>true</tt> if <tt>pattern</tt>
+ # matches {#content}, <tt>false</tt> otherwise.
#
- # @param [RegExp, String] match
+ # @param [Regexp, String] match
# @return [Boolean]
#
# @see #match
@@ -125,7 +125,7 @@ def parser
# Returns a Hash containing all supported properties for this answer
# along with corresponding values.
#
- # @return [Hash]
+ # @return [{ Symbol => Object }]
def properties
hash = {}
Parser::PROPERTIES.each { |property| hash[property] = send(property) }
@@ -134,9 +134,8 @@ def properties
# Returns <tt>true</tt> if the <tt>property</tt> passed as symbol
# is supported by any available parser for this answer.
- # See also <tt>Whois::Answer::Parser.supported?</tt>.
#
- # @param [Symbol] property - The name of the property to check.
+ # @param [Symbol] property The name of the property to check.
# @return [Boolean]
#
# @see Whois::Answer::Parser#property_supported?
@@ -146,9 +145,9 @@ def property_supported?(property)
end
- # Checks whether this Answer is different than +other+.
+ # Checks whether this {Answer} is different than +other+.
#
- # Comparing the Answer content is not as trivial as you may think.
+ # Comparing the {Answer} content is not as trivial as you may think.
# WHOIS servers can inject into the WHOIS response strings that changes at every request,
# such as the timestamp the request was generated or the number of requests left
# for your current IP.
@@ -186,9 +185,9 @@ def unchanged?(other)
# Collects and returns all the contacts.
#
- # @return [Array<Whois::Aswer::Contact>]
+ # @return [Array<Whois::Answer::Contact>]
#
- # @see Whois::Answer::Parser#contacts?
+ # @see Whois::Answer::Parser#contacts
#
def contacts
parser.contacts
6 lib/whois/answer/contact.rb
View
@@ -21,11 +21,11 @@ module Whois
class Answer
#
- # = Contacts
+ # = Contact
#
- # Holds the details of a <tt>Contact</tt> extracted from the WHOIS <tt>Answer</tt>.
+ # Holds the details of a {Whois::Answer::Contact} extracted from the WHOIS response.
#
- # A <tt>Contact</tt> is composed by the following attributes:
+ # A contact is composed by the following attributes:
#
# * <tt>:id</tt>:
# * <tt>:type</tt>: the contact type (1 = registrant, 2 = admin, 3 = technical).
2  lib/whois/answer/nameserver.rb
View
@@ -23,7 +23,7 @@ class Answer
#
# = Nameserver
#
- # Holds the details of the Name Servers extracted from the WHOIS answer.
+ # Holds the details of the Name Servers extracted from the WHOIS response.
#
# A Nameserver is composed by the following attributes:
#
106 lib/whois/answer/parser.rb
View
@@ -39,9 +39,14 @@ class Parser
:nameservers,
]
+ # @return [Whois::Answer] The answer referenced by this parser.
attr_reader :answer
+ # Initializes and return a new parser from +answer+.
+ #
+ # @param [Whois::Answer]
+ #
def initialize(answer)
@answer = answer
end
@@ -49,13 +54,20 @@ def initialize(answer)
# Returns an array with all host-specific parsers initialized for the parts
# contained into this parser.
# The array is lazy-initialized.
+ #
+ # @return [Array<Whois::Answer::Parser::Base>]
+ #
def parsers
@parsers ||= init_parsers
end
# Returns <tt>true</tt> if the <tt>property</tt> passed as symbol
# is supported by any available parser.
- # See also <tt>Whois::Answer::Parser::Base.supported?</tt>.
+ #
+ # @return [Boolean]
+ #
+ # @see Whois::Answer::Parser::Base.property_supported?
+ #
def property_supported?(property)
parsers.any? { |parser| parser.property_supported?(property) }
end
@@ -94,10 +106,10 @@ def unchanged?(other)
# Collects and returns all the contacts from all the answer parts.
#
- # @return [Array<Whois::Aswer::Contact>]
+ # @return [Array<Whois::Answer::Contact>]
#
- # @see Whois::Answer#contacts?
- # @see Whois::Answer::Parser::Base#contacts?
+ # @see Whois::Answer#contacts
+ # @see Whois::Answer::Parser::Base#contacts
#
def contacts
parsers.inject([]) { |all, parser| all.concat(parser.contacts) }
@@ -155,15 +167,12 @@ def delegate_to_parsers(method, *args, &block)
# and returns the final array of server-specific parsers.
#
# Parsers are initialized in reverse order for performance reason.
- # See also <tt>#select_parser</tt>.
#
- # ==== Returns
+ # @return [Array<Class>] An array of Class,
+ # where each item is the parts reverse-N specific parser {Class}.
+ # Each {Class} is expected to be a child of {Whois::Answer::Parser::Base}.
#
- # Returns an Array of Class,
- # where each item is the parts reverse-N specific parser Class.
- # Each Class is expected to be a child of Whois::Answer::Parser::Base.
- #
- # ==== Examples
+ # @example
#
# parser.parts
# # => [whois.foo.com, whois.bar.com]
@@ -171,26 +180,24 @@ def delegate_to_parsers(method, *args, &block)
# parser.parsers
# # => [Whois::Answer::Parser::WhoisBarCom, Whois::Answer::Parser::WhoisFooCom]
#
+ # @see Whois::Answer::Parser#select_parser
+ #
def init_parsers
answer.parts.reverse.map { |part| self.class.parser_for(part) }
end
- # Selects the first parser in <tt>#parsers</tt>
- # where <tt>given</tt> matches <tt>status</tt>.
+ # Selects the first parser in {#parsers}
+ # where given property matches <tt>status</tt>.
#
- # ==== Parameters
+ # @param [Symbol] property The property to search for.
+ # @param [Symbol] status The status value.
#
- # property:: The Symbol property to search for.
- # status:: The Symbol status (default: :any).
+ # @return [Whois::Answer::Parser::Base]
+ # The parser which satisfies given requirement.
+ # @return [nil]
+ # If the parser wasn't found.
#
- # ==== Returns
- #
- # Whois::Answer::Parser::Base::
- # The parser which satisfies given requirement.
- # nil::
- # If the parser wasn't found.
- #
- # ==== Examples
+ # @example
#
# select_parser(:nameservers)
# # => #<Whois::Answer::Parser::WhoisExampleCom>
@@ -221,24 +228,21 @@ def all_with_args?(*args, &block)
# The parser class is selected according to the
# value of the <tt>#host</tt> attribute for given <tt>part</tt>.
#
- # ==== Parameters
- #
- # part:: The Whois::Answer::Parser::Part to get the parser for.
+ # @param [Whois::Answer::Part] part The part to get the parser for.
#
- # ==== Returns
- #
- # Returns an instance of the specific parser for given part.
- # The instance is expected to be a child of Whois::Answer::Parser::Base.
+ # @return [Whois::Answer::Parser::Base]
+ # An instance of the specific parser for given part.
+ # The instance is expected to be a child of {Whois::Answer::Parser::Base}.
#
- # ==== Examples
+ # @example
#
# # Parser for a known host
# Parser.parser_for("whois.example.com")
- # #<Whois::Answer::Parser::WhoisExampleCom>
+ # # => #<Whois::Answer::Parser::WhoisExampleCom>
#
# # Parser for an unknown host
# Parser.parser_for("missing.example.com")
- # #<Whois::Answer::Parser::Blank>
+ # # => #<Whois::Answer::Parser::Blank>
#
def self.parser_for(part)
parser_klass(part.host).new(part)
@@ -251,19 +255,15 @@ def self.parser_for(part)
# a custom parser, simple make sure the class is loaded in the Ruby
# environment before this method is called.
#
- # ==== Parameters
- #
- # host:: A String with the host.
+ # @param [String] host The server host.
#
- # ==== Returns
+ # @return [Class] The instance of Class representing the parser Class
+ # corresponding to <tt>host</tt>. If <tt>host</tt> doesn't have
+ # a specific parser implementation, then returns
+ # the {Whois::Answer::Parser::Blank} {Class}.
+ # The {Class} is expected to be a child of {Whois::Answer::Parser::Base}.
#
- # Returns an instance of Class representing the parser Class
- # corresponding to <tt>host</tt>.
- # If <tt>host</tt> doesn't have a specific parser implementation,
- # then returns the Whois::Answer::Parser::Blank Class.
- # The Class is expected to be a child of Whois::Answer::Parser::Base.
- #
- # ==== Examples
+ # @example
#
# Parser.parser_klass("missing.example.com")
# # => Whois::Answer::Parser::Blank
@@ -287,11 +287,10 @@ def self.parser_klass(host)
# Converts <tt>host</tt> to the corresponding parser class name.
#
- # ==== Parameters
- #
- # host:: A String with the host.
+ # @param [String] host The server host.
+ # @return [String] The class name.
#
- # ==== Examples
+ # @example
#
# Parser.host_to_parser("whois.nic.it")
# # => "WhoisNicIt"
@@ -299,7 +298,6 @@ def self.parser_klass(host)
# Parser.host_to_parser("whois.nic-info.it")
# # => "WhoisNicInfoIt"
#
- # Returns a String with the class name.
def self.host_to_parser(host)
host.to_s.
gsub(/[.-]/, '_').
@@ -308,13 +306,9 @@ def self.host_to_parser(host)
# Requires the file at <tt>whois/answer/parser/#{name}</tt>.
#
- # ==== Parameters
- #
- # name:: A string with the file name.
- #
- # ==== Returns
+ # @param [String] name The file name to load.
#
- # Nothing.
+ # @return [void]
#
def self.autoload(name)
file = "whois/answer/parser/#{name}"
6 lib/whois/answer/parser/base.rb
View
@@ -265,7 +265,7 @@ def unchanged?(other)
# Collects and returns all the available contacts.
#
- # @return [Array<Whois::Aswer::Contact>]
+ # @return [Array<Whois::Answer::Contact>]
#
# @see Whois::Answer#contacts
# @see Whois::Answer::Parser#contacts
@@ -281,10 +281,10 @@ def contacts
# Checks whether this is a throttle response.
# The default implementation always returns +false+.
#
- # @abstract This method returns false by default.
- #
# @return [false]
#
+ # @abstract This method returns false by default.
+ #
# @see Whois::Answer#throttle?
# @see Whois::Answer::Parser#throttle?
#
6 lib/whois/answer/part.rb
View
@@ -23,12 +23,12 @@ class Answer
#
# = Part
#
- # A single <tt>Whois::Answer</tt> fragment. For instance,
- # in case of thin server, a <tt>Whois::Answer</tt> may be composed by
+ # A single {Whois::Answer} fragment. For instance,
+ # in case of thin server, a {Whois::Answer} can be composed by
# one or more parts corresponding to all responses
# returned by the WHOIS servers.
#
- # A <tt>Part</tt> is composed by the following attributes:
+ # A part is composed by the following attributes:
#
# * body - The body containing the whois output.
# * host - The host which returned the body.
2  lib/whois/answer/registrar.rb
View
@@ -23,7 +23,7 @@ class Answer
#
# = Registrar
#
- # Holds the details of the Registrar extracted from the WHOIS answer.
+ # Holds the details of the Registrar extracted from the WHOIS response.
#
# A Registrar is composed by the following attributes:
#
23 lib/whois/answer/super_struct.rb
View
@@ -20,7 +20,7 @@
#
# = SuperStruct
#
-# SuperStruct is an enhanced version of the Ruby Standar library <tt>Struct</tt>.
+# SuperStruct is an enhanced version of the Ruby Standard library {Struct}.
#
# Compared with the original version, it provides the following additional features:
# * ability to initialize an instance from Hash
@@ -28,15 +28,28 @@
#
class SuperStruct < Struct
- # Overwrites the standard Struct initializer
- # to add the ability to create an instance from a Hash of parameters.
+ # Overwrites the standard {Struct} initializer
+ # to add the ability to create an instance from a {Hash} of parameters.
#
+ # @overload initialize({ Symbol => Object })
+ # Initializes the object with a key/value hash.
+ # @param [{ Symbol => Object }] values
+ # @return [SuperStruct]
+ # @overload initialize([ value1, value1, ... ])
+ # Initializes the object with given values.
+ # @param [Array] values
+ # @return [SuperStruct]
+ # @overload initialize(value1, value1, ...)
+ # Initializes the object with given values.
+ # @return [SuperStruct]
+ #
+ # @yield self
+ #
+ # @example
# attributes = { :foo => 1, :bar => "baz" }
# Struct.new(attributes)
# # => #<Struct foo=1, bar="baz">
#
- # If block is given, the block is called on self.
- #
def initialize(*args, &block)
if args.first.is_a? Hash
initialize_with_hash(args.first)
32 lib/whois/client.rb
View
@@ -21,29 +21,26 @@ module Whois
class Client
- # The Integer maximum time to run a whois query, expressed in seconds.
+ # The maximum time to run a WHOIS query, expressed in seconds.
+ #
+ # @return [Fixnum] Timeout value in seconds.
DEFAULT_TIMEOUT = 10
+ # @return [Fixnum, nil] The current timeout value, expressed in seconds.
attr_accessor :timeout
# Initializes a new <tt>Whois::Client</tt> with <tt>options</tt>.
#
- # 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 <tt>block</tt> is given, yields <tt>self</tt>.
#
- # ==== Returns
+ # @param [Hash] options Hash of options.
+ # @option options [Fixnum, nil] :timeout (DEFAULT_TIMEOUT)
+ # The script timeout, expressed in seconds.
#
- # Whois::Client:: The client instance.
+ # @yield [self]
#
- # ==== Examples
+ # @example
#
# client = Whois::Client.new do |c|
# c.timeout = nil
@@ -59,15 +56,12 @@ def initialize(options = {}, &block)
# Queries the right WHOIS server for <tt>qstring</tt> and returns
# the response from the server.
#
- # ==== Parameters
- #
- # qstring:: The String to be sent as query parameter.
- #
- # ==== Returns
+ # @param [String] qstring The string to be sent as query parameter.
+ # @return [Whois::Answer] The answer object containing the WHOIS response.
#
- # Whois::Answer:: The answer object containing the WHOIS response.
+ # @raise [Timeout::Error]
#
- # ==== Examples
+ # @example
#
# client.query("google.com")
# # => #<Whois::Answer>
26 lib/whois/errors.rb
View
@@ -25,15 +25,19 @@ class Error < StandardError
class ServerError < Error
end
- # Server Definition not found
+ # @group Server definition not found
# Raised when the class hasn't been able to select a valid server
# probably because definitions are outdated.
class ServerNotFound < ServerError
end
- # Server Definition found
+ # @endgroup
+
+ # @group Server definition found
+
+ # Generic class for Not Supported interfaces.
class InterfaceNotSupported < ServerError
end
@@ -46,14 +50,24 @@ class NoInterfaceError < InterfaceNotSupported
# standard WHOIS interface via port 43. This is the case of some
# specific domains that only provide a web–based WHOIS interface. (\x01)
class WebInterfaceError < InterfaceNotSupported
+
+ # @return [String] The URL of the web-based WHOIS interface.
attr_reader :url
+
+ # Initializes a new exception with given URL.
+ #
+ # @param [String] url The URL of the web-based WHOIS interface.
def initialize(url)
@url = url
super("This TLD has no whois server, but you can access the whois database at `#{@url}'")
end
+
end
- # Server Known object, Definition unavailable
+ # @endgroup
+
+
+ # @group Server known object, definition unavailable
# Raised when we know about a specific functionality
# but this functionality has not been implemented yet.
@@ -69,6 +83,10 @@ class ServerNotSupported < ServerError
class AllocationUnknown < ServerError
end
+ # @endgroup
+
+
+ # @group Parser errors
# Generic <tt>Whois::Answer::Parser</tt> exception class.
class ParserError < Error
@@ -94,4 +112,6 @@ class PropertyNotSupported < ParserError
class PropertyNotAvailable < ParserError
end
+ # @endgroup
+
end
138 lib/whois/server.rb
View
@@ -19,8 +19,16 @@
module Whois
+ # The {Whois::Server} class has two important roles:
+ #
+ # 1. it acts as a database for the WHOIS server definitions
+ # 2. it is responsible for selecting the right adapter used to handle the query to the WHOIS server(s).
+ #
class Server
+ # The {Whois::Server::Adapters} module is a namespace for all
+ # WHOIS server adapters. Each adapter is a subclass of {Whois::Server::Adapters::Base},
+ # customized to handle WHOIS queries for a type or a group of servers.
module Adapters
autoload :Base, "whois/server/adapters/base"
autoload :Arpa, "whois/server/adapters/arpa"
@@ -35,11 +43,17 @@ module Adapters
end
+ # The WHOIS server definitions.
+ #
+ # @return [{ Symbol => Array }] The definition Hash.
+ # @private
@@definitions = {}
- # Searches the /definitions folder for definition files and loads them.
+ # Searches the +/definitions+ folder for definition files and loads them.
# This method is automatically invoked when this file is parsed
# by the Ruby interpreter (scroll down to the bottom of this file).
+ #
+ # @return [void]
def self.load_definitions
Dir[File.dirname(__FILE__) + '/definitions/*.rb'].each { |file| load(file) }
end
@@ -47,24 +61,23 @@ def self.load_definitions
# Lookup and returns the definition list for given <tt>type</tt>,
# or all definitions if <tt>type</tt> is <tt>nil</tt>.
#
- # ==== Parameters
- #
- # type:: The type of WHOIS server to lookup.
+ # @param [Symbol] type The type of WHOIS server to lookup.
# Known values are :tld, :ipv4, :ipv6.
#
- # ==== Returns
- #
- # Hash:: If the method is called without specifying a <tt>type</tt>.
- # Array:: If the method is called specifying a <tt>type</tt>,
- # and the <tt>type</tt> exists.
- # nil:: If the method is called specifying a <tt>type</tt>,
- # and the <tt>type</tt> doesn't exist.
+ # @return [{ Symbol => Array }]
+ # The definition Hash if +type+ is +nil+.
+ # @return [Array<Hash>]
+ # The definitions for given +type+ if +type+ is not +nil+ and +type+ exists.
+ # @return [nil]
+ # The definitions for given +type+ if +type+ is not +nil+ and +type+ doesn't exist.
#
- # ==== Examples
+ # @example Return the definition database.
#
# Whois::Server.definitions
# # => { :tld => [...], :ipv4 => [], ... }
#
+ # @example Return the definitions for given key.
+ #
# Whois::Server.definitions(:tld)
# # => [...]
#
@@ -81,26 +94,22 @@ def self.definitions(type = nil)
# Defines a new server for <tt>:type</tt> queries.
#
- # ==== Parameters
- #
- # type:: The type of WHOIS server to define.
- # Known values are :tld, :ipv4, :ipv6.
- # allocation:: The allocation, range or hostname
- # this server is responsible for.
- # host:: The server hostname.
- # Use nil if unknown or not available.
- # options:: Hash of options (default: {}).
- # The <tt>:adapter</tt> option has a special meaning
- # and determines the adapter Class to use.
- # Defaults to </tt>Whois::Server::Adapters::Standard</tt>
- # unless specified. All the other options are passed
- # directly to the adapter which can decide how to use them.
- #
- # ==== Returns
+ # @param [Symbol] type
+ # The type of WHOIS server 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 definition properties.
+ # @option options [Class] :adapter (Whois::Server::Adapters::Standard)
+ # This option has a special meaning and determines the adapter Class to use.
+ # Defaults to {Whois::Server::Adapters::Standard} unless specified.
+ # All the other options are passed directly to the adapter which can decide how to use them.
#
- # Nothing.
+ # @return [void]
#
- # ==== Examples
+ # @example
#
# # Define a server for the .it extension
# Whois::Server.define :tld, ".it", "whois.nic.it"
@@ -128,7 +137,7 @@ def self.define(type, allocation, host, options = {})
# Creates a new server adapter from given arguments
# and returns the server instance.
#
- # By default, returns a new Whois::Servers::Adapter::Standard instance.
+ # By default, returns a new {Whois::Server::Adapters::Standard} instance.
# You can customize the behavior passing a custom adapter class
# as <tt>:adapter</tt> option.
#
@@ -140,30 +149,25 @@ def self.define(type, allocation, host, options = {})
# # => #<Whois::Servers::Adapter::Custom>
#
# Please note that any adapter is responsible for a limited set
- # of queries, which should be included in the range
- # of the <tt>allocation</tt> parameter.
- # Use <tt>Whois::Server#guess</tt> if you are not sure which adapter
+ # of queries, which should be included in the range of the <tt>allocation</tt> parameter.
+ # Use {Whois::Server.guess} if you are not sure which adapter
# is the right one for a specific string.
#
- # ==== Parameters
- #
- # type:: The type of WHOIS server to define.
- # Known values are :tld, :ipv4, :ipv6.
- # allocation:: The allocation, range or hostname
- # this server is responsible for.
- # host:: The server hostname.
- # Use nil if unknown or not available.
- # options:: Hash of options (default: {}).
- # The <tt>:adapter</tt> option has a special meaning
- # and determines the adapter Class to use.
- # Defaults to </tt>Whois::Server::Adapters::Standard</tt>
- # unless specified. All the other options are passed
- # directly to the adapter which can decide how to use them.
- #
- # ==== Returns
- #
- # Whois::Server::Adapters::Standard::
- # An adapter that can be used to perform queries.
+ # @param [Symbol] type
+ # The type of WHOIS server 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 definition properties.
+ # @option options [Class] :adapter (Whois::Server::Adapters::Standard)
+ # This option has a special meaning and determines the adapter Class to use.
+ # Defaults to {Whois::Server::Adapters::Standard} unless specified.
+ # All the other options are passed directly to the adapter which can decide how to use them.
+ #
+ # @return [Whois::Server::Adapters::Standard]
+ # An adapter that can be used to perform queries.
#
def self.factory(type, allocation, host, options = {})
options = options.dup
@@ -182,25 +186,21 @@ def self.factory(type, allocation, host, options = {})
#
# Note that not all query types actually have a corresponding adapter.
# For instance, the following request will result in a
- # <tt>Whois::ServerNotSupported</tt> exception.
+ # {Whois::ServerNotSupported} exception.
#
# Whois::Server.guess "mail@example.com"
#
- # ==== Returns
- #
- # Whois::Server::Adapters::Base::
- # The adapter that can be used to perform
- # WHOIS queries for <tt>qstring</tt>.
- #
- # ==== Raises
- #
- # Whois::ServerNotFound::
- # When unable to find an appropriate WHOIS adapter
- # for <tt>qstring</tt>. Most of the cases, the <tt>qstring</tt>
- # haven't been recognised as one of the supported query types.
- # Whois::ServerNotSupported::
- # When the <tt>qstring</tt> type is detected,
- # but the object type doesn't have any supported WHOIS adapter associated.
+ # @return [Whois::Server::Adapters::Base]
+ # The adapter that can be used to perform
+ # WHOIS queries for <tt>qstring</tt>.
+ #
+ # @raise [Whois::ServerNotFound]
+ # When unable to find an appropriate WHOIS adapter
+ # for <tt>qstring</tt>. Most of the cases, the <tt>qstring</tt>
+ # haven't been recognised as one of the supported query types.
+ # @raise [Whois::ServerNotSupported]
+ # When the <tt>qstring</tt> type is detected,
+ # but the object type doesn't have any supported WHOIS adapter associated.
#
def self.guess(qstring)
# Top Level Domain match
2  lib/whois/version.rb
View
@@ -16,6 +16,7 @@
module Whois
+ # Holds information about library version.
module Version
MAJOR = 1
MINOR = 6
@@ -25,6 +26,7 @@ module Version
STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
end
+ # The current library version.
VERSION = Version::STRING
end
Please sign in to comment.
Something went wrong with that request. Please try again.