Module: Whoaz
- Defined in:
- lib/whoaz.rb,
lib/whoaz/whois.rb,
lib/whoaz/errors.rb,
lib/whoaz/version.rb
Defined Under Namespace
Classes: EmptyDomain, Error, InvalidDomain, ServerError, Whois
Constant Summary collapse
- WHOIS_URL =
'http://nic.az/cgi-bin/whois.cgi'
- WHOIS_REFERER =
The URL to the WHOIS server. It’s the same as
http://whois.az
. 'http://nic.az'
- MAIN_TLD =
%w(az biz.az co.az com.az edu.az gov.az info.az int.az mil.az name.az net.az org.az pp.az pro.az)
- REGIONAL_TLD =
%w(bilesuvar.az ganja.az imishli.az samux.az shamaxi.az shusha.az sumgait.az zaqatala.az)
- VERSION =
"2.0.0"
Class Method Summary collapse
-
.whois(domain = '') ⇒ Whoaz::Whois
Creates a new Whois object.
Class Method Details
.whois(domain = '') ⇒ Whoaz::Whois
Creates a new Whois object.
17 18 19 20 21 22 |
# File 'lib/whoaz.rb', line 17 def self.whois(domain='') domain = domain.to_s.strip.downcase raise EmptyDomain, "Domain name is not specified" if domain.empty? raise InvalidDomain, "Domain name contains non-ASCII characters" if domain =~ /[^\x00-\x7f]/ Whoaz::Whois.new(domain) end |