Class: NominetEPP::Custom::ListResponse
- Inherits:
-
BasicResponse
- Object
- BasicResponse
- NominetEPP::Custom::ListResponse
- Defined in:
- lib/nominet-epp/responses/custom/list_response.rb
Instance Method Summary collapse
- #domains ⇒ Object
-
#initialize(response) ⇒ ListResponse
constructor
A new instance of ListResponse.
- #namespaces ⇒ Object
- #parse_listData ⇒ Object protected
Methods inherited from BasicResponse
#method, #method_missing, #respond_to?, #respond_to_missing?
Constructor Details
#initialize(response) ⇒ ListResponse
Returns a new instance of ListResponse.
4 5 6 7 |
# File 'lib/nominet-epp/responses/custom/list_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
#domains ⇒ Object
9 10 11 |
# File 'lib/nominet-epp/responses/custom/list_response.rb', line 9 def domains @domains ||= parse_listData end |
#namespaces ⇒ Object
13 14 15 |
# File 'lib/nominet-epp/responses/custom/list_response.rb', line 13 def namespaces { 'list' => 'http://www.nominet.org.uk/epp/xml/std-list-1.0' } end |
#parse_listData ⇒ Object (protected)
18 19 20 21 22 23 24 25 26 |
# File 'lib/nominet-epp/responses/custom/list_response.rb', line 18 def parse_listData domains = [] @response.data.find('//list:domainName', namespaces).each do |node| domains << node.content.strip end domains end |