lib/whois/domain/base.rb in jm81-whois-0.5.0 vs lib/whois/domain/base.rb in jm81-whois-0.6.0
- old
+ new
@@ -8,11 +8,13 @@
:created_on => "Creation Date",
:updated_on => "Updated Date",
:expires_on => "Expiration Date",
:status => "Status",
:name_servers => "Name Server",
- :whois_server => "Whois Server"
+ :whois_server => "Whois Server",
+ :registrant_id => "Registrant",
+ :administrative_id => "Administrative"
}
# Inherited classes call class method +responds_to+ to say for which TLDs
# that class is responsible.
#
@@ -53,12 +55,20 @@
# Based on Michael Neumann's library.
def query
s = TCPsocket.open(host, 43)
s.write(query_string)
@raw = s.gets(nil)
+ raise(Whois::LookupRestricted, @raw) if lookup_restricted?
s.close
end
+
+ # Check whether this server is restricting lookups (probably due to exceeding
+ # the maximum allowed lookups. The Base method always returns false, since
+ # checking for this is server-specific.
+ def lookup_restricted?
+ false
+ end
private :attr_names, :query_string, :query
# Get Hash of attributes, by iterating through each line of +@raw+. If the
# line matches the class's ATTR_MATCH constant, it is added to the +@attrs+
@@ -154,9 +164,19 @@
# Array of name servers for domain
def name_servers
attr_array(:name_servers)
end
+ # ID of this domain's Registrant
+ def registrant_id
+ attr_single(:registrant_id)
+ end
+
+ # ID of this domain's Admin contact
+ def administrative_id
+ attr_single(:administrative_id)
+ end
+
# Alias for +name_servers+
def ns
name_servers
end