Class: NominetEPP::Custom::HandshakeResponse
Instance Method Summary
collapse
#method, #method_missing, #respond_to?, #respond_to_missing?
Constructor Details
Returns a new instance of HandshakeResponse.
4
5
6
7
|
# File 'lib/nominet-epp/responses/custom/handshake_response.rb', line 4
def initialize(response)
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
super
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class NominetEPP::BasicResponse
Instance Method Details
#case_id ⇒ Object
9
10
11
|
# File 'lib/nominet-epp/responses/custom/handshake_response.rb', line 9
def case_id
@case_id ||= @response.data.find('//h:caseId', namespaces).first.content.strip
end
|
#domains ⇒ Object
13
14
15
|
# File 'lib/nominet-epp/responses/custom/handshake_response.rb', line 13
def domains
@domains ||= parse_domainList
end
|
#namespaces ⇒ Object
17
18
19
|
# File 'lib/nominet-epp/responses/custom/handshake_response.rb', line 17
def namespaces
{ 'h' => 'http://www.nominet.org.uk/epp/xml/std-handshake-1.0' }
end
|
#parse_domainList ⇒ Object
22
23
24
25
26
27
28
29
30
|
# File 'lib/nominet-epp/responses/custom/handshake_response.rb', line 22
def parse_domainList
domains = []
@response.data.find('//h:domainName', namespaces).each do |node|
domains << node.content.strip
end
domains
end
|