Module: Whois
- Defined in:
- lib/whois.rb,
lib/whois/client.rb,
lib/whois/errors.rb,
lib/whois/record.rb,
lib/whois/server.rb,
lib/whois/version.rb,
lib/whois/record/part.rb,
lib/whois/server/adapters/web.rb,
lib/whois/server/adapters/arin.rb,
lib/whois/server/adapters/arpa.rb,
lib/whois/server/adapters/base.rb,
lib/whois/server/adapters/none.rb,
lib/whois/server/socket_handler.rb,
lib/whois/server/adapters/afilias.rb,
lib/whois/server/adapters/standard.rb,
lib/whois/server/adapters/verisign.rb,
lib/whois/server/adapters/formatted.rb,
lib/whois/server/adapters/not_implemented.rb
Defined Under Namespace
Classes: AllocationUnknown, Client, ConnectionError, Error, InterfaceNotSupported, NoInterfaceError, Record, Server, ServerError, ServerNotFound, ServerNotImplemented, ServerNotSupported, WebInterfaceError
Constant Summary collapse
- VERSION =
The current library version.
"5.1.0"
Class Method Summary collapse
- .available?(object) ⇒ Boolean deprecated Deprecated.
-
.bug!(error, message) ⇒ void
private
Appends Please report issue to to the message and raises a new
errorwith the final message. - .deprecate(message = nil, callstack = caller) ⇒ Object
-
.lookup(object) ⇒ Whois::Record
(also: whois)
Queries the WHOIS server for
objectand returns the response from the server. - .registered?(object) ⇒ Boolean deprecated Deprecated.
Class Method Details
.available?(object) ⇒ Boolean
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/whois.rb', line 44 def available?(object) unless defined? Whois::Parser warn("Whois.available? requires the gem `whois-parser`") return end deprecate(%{Whois.available? is deprecated. Call Whois.whois("#{object}").parser.available?}) result = lookup(object).parser.available? if result.nil? warn "This method is not supported for this kind of object.\n" \ "Use Whois.lookup('#{object}') instead." end result end |
.bug!(error, message) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Appends Please report issue to to the message and raises a new error with the final message.
91 92 93 94 95 |
# File 'lib/whois.rb', line 91 def bug!(error, ) raise error, .dup << " Please report the issue at" \ " http://github.com/weppos/whois/issues" end |
.deprecate(message = nil, callstack = caller) ⇒ Object
77 78 79 80 |
# File 'lib/whois.rb', line 77 def deprecate( = nil, callstack = caller) # warn("DEPRECATION WARNING: #{message} #{deprecation_caller_message(callstack)}") warn("DEPRECATION WARNING: #{}") end |
.lookup(object) ⇒ Whois::Record Also known as: whois
Queries the WHOIS server for object and returns the response from the server.
36 37 38 |
# File 'lib/whois.rb', line 36 def lookup(object) Client.new.lookup(object) end |
.registered?(object) ⇒ Boolean
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/whois.rb', line 61 def registered?(object) unless defined? Whois::Parser warn("Whois.registered? requires the gem `whois-parser`") return end deprecate(%{Whois.registered? is deprecated. Call Whois.whois("#{object}").parser.registered?}) result = lookup(object).parser.registered? if result.nil? warn "This method is not supported for this kind of object.\n" \ "Use Whois.lookup('#{object}') instead." end result end |