Whois Parser Properties & Methods
Each WHOIS parser exposes a defined set of WHOIS properties and WHOIS methods, in addition to the standard object methods and attributes.
WHOIS methods and properties are useful to access the content of a WHOIS response like an object. For example, if you want to extract the expiration date from the following response
*********************************************************************
* Please note that the following result could be a subgroup of *
* the data contained in the database. *
* *
* Additional information can be visualized at: *
* http://www.nic.it/cgi-bin/Whois/whois.cgi *
*********************************************************************
Domain: google.it
Status: ok / autoRenewPeriod
Created: 1999-12-10 00:00:00
Last Update: 2010-11-28 00:48:53
Expire Date: 2010-11-27
just use the #created_at
property. For further details about Whois::Record
and Whois::Record::Parser
property usage, please visit the "Whois Parser chapter":/manual/parser/.
Here's the full WHOIS property and method list with the corresponding returned value.
Properties
WHOIS properties are attributes of the WHOIS response. The parser simply attempts to extract them from the content of the response, apply some basic transformations such as trimming additional spaces or converting the value into an object, and returns the value as it is.
Property | Returns |
disclaimer |
String / Nil |
domain |
String / Nil |
domain_id |
String / Nil |
status |
String / Nil |
registered? |
Boolean |
available? |
Boolean |
created_on |
Time / Nil |
updated_on |
Time / Nil |
expires_on |
Time / Nil |
registrar |
Whois::Record::Registrar / Nil |
registrant_contacts |
Array<Whois::Record::Contact> |
admin_contacts |
Array<Whois::Record::Contact> |
technical_contacts |
Array<Whois::Record::Contact> |
nameservers |
Array<Whois::Record::Nameserver> |
Methods
WHOIS methods are a little bit more complex that properties because they parse the content of the WHOIS response to return an elaborated information.
For instance, the method #changed?
attempts to guess if the current WHOIS response changed compared to an other WHOIS response passed as parameter.
Method | Returns |
changed? |
Boolean |
unchanged? |
Boolean |
contacts |
Array<Whois::Record::Contact> |