Class: Epp::Eis::CreditInfoResponse
- Inherits:
-
Object
- Object
- Epp::Eis::CreditInfoResponse
- Defined in:
- lib/epp-eis/credit.rb
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(response) ⇒ CreditInfoResponse
constructor
A new instance of CreditInfoResponse.
- #message ⇒ Object
- #zone_credits ⇒ Object
Constructor Details
#initialize(response) ⇒ CreditInfoResponse
Returns a new instance of CreditInfoResponse.
5 6 7 |
# File 'lib/epp-eis/credit.rb', line 5 def initialize(response) @response = Nokogiri::XML(response) end |
Instance Method Details
#code ⇒ Object
9 10 11 |
# File 'lib/epp-eis/credit.rb', line 9 def code @response.css('epp response result').first['code'].to_i end |
#message ⇒ Object
13 14 15 |
# File 'lib/epp-eis/credit.rb', line 13 def @response.css('epp response result msg').text end |
#zone_credits ⇒ Object
17 18 19 20 21 22 |
# File 'lib/epp-eis/credit.rb', line 17 def zone_credits @response.css('fred|resCreditInfo fred|zoneCredit', 'fred' => XML_NS_FRED).inject({}) do |memo, item| memo[item.css('fred|zone', 'fred' => XML_NS_FRED).text] = item.css('fred|credit', 'fred' => XML_NS_FRED).text memo end end |