Skip to content

Commit

Permalink
YARDOC
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Nov 28, 2010
1 parent fa6d7b8 commit 1ce00b5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 39 deletions.
72 changes: 35 additions & 37 deletions lib/whois.rb
Expand Up @@ -29,26 +29,18 @@ module Whois
AUTHORS = ["Simone Carletti <weppos@weppos.net>"]


# Queries the right WHOIS server for <tt>qstring</tt> and returns
# Queries the WHOIS server for <tt>qstring</tt> and returns
# the response from the server.
#
# ==== Parameters
#
# qstring:: The String to be sent as query parameter.
#
# ==== Returns
#
# Whois::Answer:: The answer containing the response from the WHOIS server.
#
# ==== Examples
# @param [String] qstring The string to be sent as query parameter.
# @return [Whois::Answer] The answer containing the response from the WHOIS server.
#
# @example
# Whois.query("google.com")
# # => #<Whois::Answer>
#
# This is equivalent to
#
# # Equivalent to
# Whois::Client.new.query("google.com")
# # => #<Whois::Answer>
#
def self.query(qstring)
Client.new.query(qstring)
Expand All @@ -68,21 +60,16 @@ class << self
# This is a technical limitation. Browse the lib/whois/answer/parsers
# folder to view all available parsers.
#
# ==== Parameters
#
# qstring:: The String to be sent as query parameter.
# It is intended to be a domain name, otherwise this method
# may return unexpected responses.
#
# ==== Returns
#
# Boolean
#
# ==== Examples
# @param [String] qstring 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
#
Expand All @@ -104,21 +91,16 @@ def self.available?(qstring)
# This is a technical limitation. Browse the lib/whois/answer/parsers folder
# to view all available parsers.
#
# ==== Parameters
#
# qstring:: The String to be sent as query parameter.
# It is intended to be a domain name, otherwise this method
# may return unexpected responses.
#
# ==== Returns
#
# Boolean
#
# ==== Examples
# @param [String] qstring 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
#
Expand All @@ -132,12 +114,28 @@ def self.registered?(qstring)
end


def self.deprecate(message = nil) # :nodoc:
# Echoes a deprecation warning message.
#
# @param [String] message The message to display.
# @return [void]
#
# @api internal
# @private
def self.deprecate(message = nil)
message ||= "You are using deprecated behavior which will be removed from the next major or minor release."
warn("DEPRECATION WARNING: #{message}")
end

def self.bug!(error, message) # :nodoc:
# 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 internal
# @private
def self.bug!(error, message)
raise error, message.dup <<
" Please report the issue at" <<
" http://github.com/weppos/whois/issues"
Expand Down
4 changes: 2 additions & 2 deletions lib/whois/answer.rb
Expand Up @@ -58,8 +58,8 @@ def inspect
# and returns the match as <tt>MatchData</tt> or <tt>nil</tt>.
#
# @param [RegExp, String] match
# @return [MatchData] If pattern matches {#content}
# @return [nil] If pattern doesn't match {#content}
# @return [MatchData] If pattern matches #content
# @return [nil] If pattern doesn't match #content
#
# @see String#match
#
Expand Down

0 comments on commit 1ce00b5

Please sign in to comment.