Class: NominetEPP::Domain::CheckResponse

Inherits:
BasicResponse show all
Defined in:
lib/nominet-epp/responses/domain/check_response.rb

Instance Method Summary collapse

Methods inherited from BasicResponse

#method, #method_missing, #respond_to?, #respond_to_missing?

Constructor Details

#initialize(response) ⇒ CheckResponse

Returns a new instance of CheckResponse.

Raises:

  • (ArgumentError)


4
5
6
7
8
9
# File 'lib/nominet-epp/responses/domain/check_response.rb', line 4

def initialize(response)
  raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
  super EPP::Domain::CheckResponse.new(response)

  ext_chk_data
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NominetEPP::BasicResponse

Instance Method Details

#abuse_limitObject



16
17
18
# File 'lib/nominet-epp/responses/domain/check_response.rb', line 16

def abuse_limit
  @abuse_limit
end

#ext_chk_dataObject (protected)



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/nominet-epp/responses/domain/check_response.rb', line 25

def ext_chk_data
  [@response.extension].flatten.compact.each do |node|
    next unless node.name == 'chkData'

    node.find('//domain-ext:chkData', namespaces).each do |chkData|
      @abuse_limit = chkData['abuse-limit'].to_i
    end

    node.find('//nom-direct-rights:chkData', namespaces).each do |chkData|
      @right_of_registration = chkData.find('nom-direct-rights:ror').first.content.strip
      @right_of_registration = nil if @right_of_registration == ""
    end
  end
end

#namespacesObject



11
12
13
14
# File 'lib/nominet-epp/responses/domain/check_response.rb', line 11

def namespaces
  { 'domain-ext' => 'http://www.nominet.org.uk/epp/xml/domain-nom-ext-1.2',
    'nom-direct-rights' => 'http://www.nominet.org.uk/epp/xml/nom-direct-rights-1.0' }
end

#right_of_registrationObject



20
21
22
# File 'lib/nominet-epp/responses/domain/check_response.rb', line 20

def right_of_registration
  @right_of_registration
end