Class: NominetEPP::Domain::UnrenewResponse
- Inherits:
-
BasicResponse
- Object
- BasicResponse
- NominetEPP::Domain::UnrenewResponse
- Defined in:
- lib/nominet-epp/responses/domain/unrenew_response.rb
Instance Method Summary collapse
- #expired ⇒ Object protected
- #expires?(name) ⇒ Boolean
-
#initialize(response) ⇒ UnrenewResponse
constructor
A new instance of UnrenewResponse.
Methods inherited from BasicResponse
#method, #method_missing, #respond_to?, #respond_to_missing?
Constructor Details
#initialize(response) ⇒ UnrenewResponse
Returns a new instance of UnrenewResponse.
4 5 6 7 |
# File 'lib/nominet-epp/responses/domain/unrenew_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
#expired ⇒ Object (protected)
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/nominet-epp/responses/domain/unrenew_response.rb', line 14 def expired @expired ||= [@response.data].flatten.compact.inject({}) do |hash, renData| name = renData.find('domain:name').first.content.strip exDate = renData.find('domain:exDate').first.content.strip exDate = Time.parse(exDate) hash[name] = exDate hash end end |
#expires?(name) ⇒ Boolean
9 10 11 |
# File 'lib/nominet-epp/responses/domain/unrenew_response.rb', line 9 def expires?(name) expired[name] end |