Class: NominetEPP::Domain::UnrenewResponse

Inherits:
BasicResponse show all
Defined in:
lib/nominet-epp/responses/domain/unrenew_response.rb

Instance Method Summary collapse

Methods inherited from BasicResponse

#method, #method_missing, #respond_to?, #respond_to_missing?

Constructor Details

#initialize(response) ⇒ UnrenewResponse

Returns a new instance of UnrenewResponse.

Raises:

  • (ArgumentError)


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

#expiredObject (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

Returns:

  • (Boolean)


9
10
11
# File 'lib/nominet-epp/responses/domain/unrenew_response.rb', line 9

def expires?(name)
  expired[name]
end