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.
"6.0.3"
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
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/whois.rb', line 42 def available?(object) unless defined? Whois::Parser warn("Whois.available? requires the gem `whois-parser`") return false 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.
89 90 91 92 93 |
# File 'lib/whois.rb', line 89 def bug!(error, ) raise error, .dup << " Please report the issue at " \ "http://github.com/weppos/whois/issues" end |
.deprecate(message = nil, _callstack = caller) ⇒ Object
75 76 77 78 |
# File 'lib/whois.rb', line 75 def deprecate( = nil, _callstack = caller) # warn("DEPRECATION WARNING: #{message} #{deprecation_caller_message(callstack)}") warn("DEPRECATION WARNING: #{message}") end |
.lookup(object) ⇒ Whois::Record Also known as: whois
Queries the WHOIS server for object and returns the response from the server.
34 35 36 |
# File 'lib/whois.rb', line 34 def lookup(object) Client.new.lookup(object) end |
.registered?(object) ⇒ Boolean
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/whois.rb', line 59 def registered?(object) unless defined? Whois::Parser warn("Whois.registered? requires the gem `whois-parser`") return false 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 |