Skip to content

Commit

Permalink
Rename Whois::Answer to Whois::Record
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Mar 15, 2011
1 parent 0af662b commit e94d872
Show file tree
Hide file tree
Showing 1,211 changed files with 33,886 additions and 33,887 deletions.
24 changes: 12 additions & 12 deletions README.rdoc
Expand Up @@ -43,7 +43,7 @@ You might need administrator privileges on your system to install it.

== Getting Started

Note. This section covers only the essentials for getting started with the Whois library. The {documentation}[http://www.ruby-whois.org/documentation.html] provides a more accurate explanation including tutorials, more examples and technical details about the client/server/answer/parser architecture.
Note. This section covers only the essentials for getting started with the Whois library. The {documentation}[http://www.ruby-whois.org/documentation.html] provides a more accurate explanation including tutorials, more examples and technical details about the client/server/record/parser architecture.

=== Querying the Server

Expand All @@ -54,22 +54,22 @@ Check out the following examples:
# Domain WHOIS
w = Whois::Client.new
w.query("google.com")
# => #<Whois::Answer>
# => #<Whois::Record>

# TLD WHOIS
w = Whois::Client.new
w.query(".com")
# => #<Whois::Answer>
# => #<Whois::Record>

# IPv4 WHOIS
w = Whois::Client.new
w.query("74.125.67.100")
# => #<Whois::Answer>
# => #<Whois::Record>

# IPv6 WHOIS
w = Whois::Client.new
w.query("2001:db8::1428:57ab")
# => #<Whois::Answer>
# => #<Whois::Record>

The query method is stateless. For this reason, you can safely re-use the same client instance for multiple queries.

Expand All @@ -83,7 +83,7 @@ The query method is stateless. For this reason, you can safely re-use the same c
If you just need a WHOIS response and you don't care about a full control of the WHOIS Client, <tt>Whois</tt> comes with a simple method called whois. This is the simplest way to send a WHOIS request.

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

Did I mention you can even use blocks?

Expand All @@ -96,14 +96,14 @@ Did I mention you can even use blocks?
end


=== Consuming the Answer
=== Consuming the Record

Any WHOIS query returns a <tt>Whois::Answer</tt>. This object looks like a String, but it's way more powerful.
Any WHOIS query returns a <tt>Whois::Record</tt>. This object looks like a String, but it's way more powerful.

<tt>Whois::Answer</tt> encapsulates a WHOIS record and provides the ability to parse the WHOIS response programmatically, by using an object oriented syntax.
<tt>Whois::Record</tt> encapsulates a WHOIS record and provides the ability to parse the WHOIS response programmatically, by using an object oriented syntax.

a = Whois.whois("google.it")
# => #<Whois::Answer>
# => #<Whois::Record>

a.available?
# => false
Expand All @@ -114,7 +114,7 @@ Any WHOIS query returns a <tt>Whois::Answer</tt>. This object looks like a Strin
# => Fri Dec 10 00:00:00 +0100 1999

t = a.technical
# => #<Whois::Answer::Contact>
# => #<Whois::Record::Contact>
t.id
# => "TS7016-ITNIC"
t.name
Expand All @@ -124,7 +124,7 @@ Any WHOIS query returns a <tt>Whois::Answer</tt>. This object looks like a Strin
puts nameserver
end

This feature is made possible by the <tt>Whois</tt> answer parsers. Unfortunately, due to the lack of a global standard, each WHOIS server requires a specific parser. For this reason, the library doesn't support all existing WHOIS servers.
This feature is made possible by the <tt>Whois</tt> record parsers. Unfortunately, due to the lack of a global standard, each WHOIS server requires a specific parser. For this reason, the library doesn't support all existing WHOIS servers.

If you create a new parser, please consider releasing it to the public so that it can be included in a next version.

Expand Down
10 changes: 5 additions & 5 deletions lib/whois.rb
Expand Up @@ -19,7 +19,7 @@
require 'whois/errors'
require 'whois/client'
require 'whois/server'
require 'whois/answer'
require 'whois/record'


module Whois
Expand All @@ -35,11 +35,11 @@ class << self
# the response from the server.
#
# @param [String] qstring The string to be sent as query parameter.
# @return [Whois::Answer] The answer containing the response from the WHOIS server.
# @return [Whois::Record] The record containing the response from the WHOIS server.
#
# @example
# Whois.query("google.com")
# # => #<Whois::Answer>
# # => #<Whois::Record>
#
# # Equivalent to
# Whois::Client.new.query("google.com")
Expand All @@ -57,7 +57,7 @@ def query(qstring)
# for the top level domain of <tt>qstring</tt>.
# If no parser exists for <tt>qstring</tt>, you'll receive a
# warning message and the method will return <tt>nil</tt>.
# This is a technical limitation. Browse the lib/whois/answer/parsers
# This is a technical limitation. Browse the lib/whois/record/parsers
# folder to view all available parsers.
#
# @param [String] qstring The string to be sent as query parameter.
Expand Down Expand Up @@ -88,7 +88,7 @@ def available?(qstring)
# for the top level domain of <tt>qstring</tt>.
# If no parser exists for <tt>qstring</tt>, you'll receive a warning message
# and the method will return <tt>nil</tt>.
# This is a technical limitation. Browse the lib/whois/answer/parsers folder
# This is a technical limitation. Browse the lib/whois/record/parsers folder
# to view all available parsers.
#
# @param [String] qstring The string to be sent as query parameter.
Expand Down

0 comments on commit e94d872

Please sign in to comment.