Class: Epp::Eis::NssetCheckResponse

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

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ NssetCheckResponse

Returns a new instance of NssetCheckResponse.



23
24
25
# File 'lib/epp-eis/nsset.rb', line 23

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

Instance Method Details

#codeObject



27
28
29
# File 'lib/epp-eis/nsset.rb', line 27

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

#itemsObject



35
36
37
38
39
40
41
42
# File 'lib/epp-eis/nsset.rb', line 35

def items
  @response.css('nsset|chkData nsset|cd', 'nsset' => XML_NS_NSSET).collect do |nsset|
    NssetCheck.new(
      nsset.css('nsset|id', 'nsset' => XML_NS_NSSET).text,
      nsset.css('nsset|id', 'nsset' => XML_NS_NSSET).first['avail'].to_i == 1
    )
  end
end

#messageObject



31
32
33
# File 'lib/epp-eis/nsset.rb', line 31

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