From 1ce00b5fec2a887b9a1a8e71fd028bec3ef566e1 Mon Sep 17 00:00:00 2001 From: Simone Carletti Date: Sun, 28 Nov 2010 15:55:58 +0100 Subject: [PATCH] YARDOC --- lib/whois.rb | 72 ++++++++++++++++++++++----------------------- lib/whois/answer.rb | 4 +-- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/lib/whois.rb b/lib/whois.rb index d18c0f4e5..76c45de37 100644 --- a/lib/whois.rb +++ b/lib/whois.rb @@ -29,26 +29,18 @@ module Whois AUTHORS = ["Simone Carletti "] - # Queries the right WHOIS server for qstring and returns + # Queries the 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 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") # # => # # - # This is equivalent to - # + # # Equivalent to # Whois::Client.new.query("google.com") - # # => # # def self.query(qstring) Client.new.query(qstring) @@ -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 # @@ -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 # @@ -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" diff --git a/lib/whois/answer.rb b/lib/whois/answer.rb index f66c09f1a..4821639b0 100644 --- a/lib/whois/answer.rb +++ b/lib/whois/answer.rb @@ -58,8 +58,8 @@ def inspect # and returns the match as MatchData or nil. # # @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 #