class Whois::Record::Parser::WhoisCiraCa
Parser for the whois.cira.ca server.
@see Whois::Record::Parser::Example
The Example parser for the list of all available methods.
Public Instance Methods
invalid?()
click to toggle source
NEWPROPERTY
# File lib/whois/record/parser/whois.cira.ca.rb, line 162 def invalid? cached_properties_fetch(:invalid?) do status == :invalid end end
valid?()
click to toggle source
NEWPROPERTY
# File lib/whois/record/parser/whois.cira.ca.rb, line 155 def valid? cached_properties_fetch(:valid?) do !invalid? end end
version()
click to toggle source
Attempts to detect and returns the version.
TODO: This is very empiric.
Use the available status in combination with the creation date label.
NEWPROPERTY
# File lib/whois/record/parser/whois.cira.ca.rb, line 142 def version cached_properties_fetch :version do version = if content_for_scanner =~ /^% \(c\) (.+?) Canadian Internet Registration Authority/ case $1 when "2007" then "1" when "2010" then "2" end end version || Whois.bug!(ParserError, "Unable to detect version.") end end
Private Instance Methods
build_contact(element, type)
click to toggle source
# File lib/whois/record/parser/whois.cira.ca.rb, line 171 def build_contact(element, type) node(element) do |hash| Record::Contact.new( :type => type, :id => nil, :name => hash["Name"], :organization => nil, :address => hash["Postal address"], :city => nil, :zip => nil, :state => nil, :country => nil, :phone => hash["Phone"], :fax => hash["Fax"], :email => hash["Email"] ) end end