-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
#-- | ||
# Ruby Whois | ||
# | ||
# An intelligent pure Ruby WHOIS client and parser. | ||
# | ||
# Copyright (c) 2009-2018 Simone Carletti <[email protected]> | ||
#++ | ||
|
||
|
||
require_relative 'base' | ||
|
||
|
||
module Whois | ||
class Parsers | ||
|
||
# Parser for the whois.example.com server. | ||
# | ||
# In case you are not implementing all the methods, | ||
# please add the following statement to the class docblock. | ||
# | ||
# @note This parser is just a stub and provides only a few basic methods | ||
# to check for domain availability and get domain status. | ||
# Please consider to contribute implementing missing methods. | ||
class WhoisOvhCom < Base | ||
|
||
# Gets the registry disclaimer that comes with the record. | ||
# | ||
# Returns a String with the disclaimer if available, | ||
# <tt>nil</tt> otherwise. | ||
property_supported :disclaimer do | ||
nil | ||
end | ||
|
||
|
||
# Gets the domain name as stored by the registry. | ||
# | ||
# Returns a String with the domain name if available, | ||
# <tt>nil</tt> otherwise. | ||
property_supported :domain do | ||
nil | ||
end | ||
|
||
# Gets the unique domain ID as stored by the registry. | ||
# | ||
# Returns a String with the domain ID if available, | ||
# <tt>nil</tt> otherwise. | ||
property_supported :domain_id do | ||
nil | ||
end | ||
|
||
|
||
# Gets the record status or statuses. | ||
# | ||
# Returns a String/Array with the record status if available, | ||
# <tt>nil</tt> otherwise. | ||
property_supported :status do | ||
if available? | ||
:available | ||
else | ||
:registered | ||
end | ||
end | ||
|
||
# Checks whether this record is available. | ||
# | ||
# Returns true/false depending whether this record is available. | ||
property_supported :available? do | ||
!!(content_for_scanner =~ /domain name not known/) | ||
end | ||
|
||
# Checks whether this record is registered. | ||
# | ||
# Returns true/false depending this record is available. | ||
property_supported :registered? do | ||
!available? | ||
end | ||
|
||
|
||
# Gets the date the record was created, | ||
# according to the registry record. | ||
# | ||
# Returns a Time object representing the date the record was created or | ||
# <tt>nil</tt> otherwise. | ||
property_supported :created_on do | ||
nil | ||
end | ||
|
||
# Gets the date the record was last updated, | ||
# according to the registry record. | ||
# | ||
# Returns a Time object representing the date the record was last updated or | ||
# <tt>nil</tt> if not available. | ||
property_supported :updated_on do | ||
nil | ||
end | ||
|
||
# Gets the date the record is set to expire, | ||
# according to the registry record. | ||
# | ||
# Returns a Time object representing the date the record is set to expire or | ||
# <tt>nil</tt> if not available. | ||
property_supported :expires_on do | ||
nil | ||
end | ||
|
||
|
||
# Gets the registrar object containing the registrar details | ||
# extracted from the registry record. | ||
# | ||
# Returns an instance of <tt>Parser::Registrar</tt> representing the registrar or | ||
# <tt>nil</tt> if not available. | ||
property_supported :registrar do | ||
nil | ||
end | ||
|
||
|
||
# Gets the registrant contact object containing the details of the record owner | ||
# extracted from the registry record. | ||
# | ||
# Returns an instance of <tt>Parser::Contact</tt> representing the registrant contact or | ||
# <tt>nil</tt> if not available. | ||
property_supported :registrant_contacts do | ||
nil | ||
end | ||
|
||
# Gets the administrative contact object containing the details of the record administrator | ||
# extracted from the registry record. | ||
# | ||
# Returns an instance of <tt>Parser::Contact</tt> representing the administrative contact or | ||
# <tt>nil</tt> if not available. | ||
property_supported :admin_contacts do | ||
nil | ||
end | ||
|
||
# Gets the technical contact object containing the details of the technical representative | ||
# extracted from the registry record. | ||
# | ||
# Returns an instance of <tt>Parser::Contact</tt> representing the technical contact or | ||
# <tt>nil</tt> if not available. | ||
property_supported :technical_contacts do | ||
nil | ||
end | ||
|
||
|
||
# Gets the list of name server entries for this record, | ||
# extracted from the registry record. | ||
# | ||
# @example | ||
# nameserver | ||
# # => [] | ||
# | ||
# @example | ||
# nameserver | ||
# # => [ | ||
# # #<struct Parser::Nameserver name="ns1.google.com">, | ||
# # #<struct Parser::Nameserver name="ns2.google.com"> | ||
# # ] | ||
# | ||
# @return [Array<Parser::Nameserver>] | ||
property_supported :nameservers do | ||
[] | ||
end | ||
|
||
end | ||
|
||
end | ||
end |