Class: Whois::Parsers::WhoisCiraCa

Inherits:
Base
  • Object
show all
Includes:
Scanners::Scannable
Defined in:
lib/whois/parsers/whois.cira.ca.rb

Overview

Parser for the whois.cira.ca server.

Instance Attribute Summary

Attributes inherited from Base

#part

Instance Method Summary collapse

Methods included from Scanners::Scannable

included, #node, #node?, #parse

Methods inherited from Base

#changed?, #contacts, #content, #initialize, #is, parse_time, property_not_implemented, property_not_supported, property_register, property_state, property_state?, property_supported, #property_supported?, #response_incomplete?, #response_throttled?, #response_unavailable?, #unchanged?, #validate!

Constructor Details

This class inherits a constructor from Whois::Parsers::Base

Instance Method Details

#invalid?Boolean

NEWPROPERTY

Returns:

  • (Boolean)


161
162
163
164
165
# File 'lib/whois/parsers/whois.cira.ca.rb', line 161

def invalid?
  cached_properties_fetch(:invalid?) do
    status == :invalid
  end
end

#valid?Boolean

NEWPROPERTY

Returns:

  • (Boolean)


154
155
156
157
158
# File 'lib/whois/parsers/whois.cira.ca.rb', line 154

def valid?
  cached_properties_fetch(:valid?) do
    !invalid?
  end
end

#versionObject

Attempts to detect and returns the version.

TODO: This is very empiric.

Use the available status in combination with the creation date label.

NEWPROPERTY



141
142
143
144
145
146
147
148
149
150
151
# File 'lib/whois/parsers/whois.cira.ca.rb', line 141

def version
  cached_properties_fetch :version do
    version = if content_for_scanner =~ /^% \(c\) (.+?) Canadian Internet Registration Authority/
                case ::Regexp.last_match(1)
                when "2007" then "1"
                when "2010" then "2"
                end
              end
    version || Whois::Parser.bug!(ParserError, "Unable to detect version.")
  end
end