Class: Epp::Eis::ContactCheckResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/epp-eis/contact.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ContactCheckResponse



24
25
26
# File 'lib/epp-eis/contact.rb', line 24

def initialize(response)
  @response = Nokogiri::XML(response)
end

Instance Method Details

#codeObject



28
29
30
# File 'lib/epp-eis/contact.rb', line 28

def code
  @response.css('epp response result').first['code'].to_i
end

#itemsObject



36
37
38
39
40
41
42
43
44
# File 'lib/epp-eis/contact.rb', line 36

def items
  @response.css('contact|chkData contact|cd', 'contact' => XML_NS_CONTACT).collect do |contact|
    ContactCheck.new(
      contact.css('contact|id', 'contact' => XML_NS_CONTACT).text,
      contact.css('contact|id', 'contact' => XML_NS_CONTACT).first['avail'].to_i == 1,
      contact.css('contact|reason', 'contact' => XML_NS_CONTACT).text
    )
  end
end

#messageObject



32
33
34
# File 'lib/epp-eis/contact.rb', line 32

def message
  @response.css('epp response result msg').text
end