Class: PagSeguro::Installment::ResponseSerializer
- Inherits:
-
Object
- Object
- PagSeguro::Installment::ResponseSerializer
- Defined in:
- lib/pagseguro/installment/response_serializer.rb
Instance Attribute Summary collapse
-
#xml ⇒ Object
readonly
The installment that will be serialized.
Instance Method Summary collapse
-
#initialize(xml) ⇒ ResponseSerializer
constructor
A new instance of ResponseSerializer.
- #serialize ⇒ Object
Constructor Details
#initialize(xml) ⇒ ResponseSerializer
Returns a new instance of ResponseSerializer.
7 8 9 |
# File 'lib/pagseguro/installment/response_serializer.rb', line 7 def initialize(xml) @xml = xml end |
Instance Attribute Details
#xml ⇒ Object (readonly)
The installment that will be serialized
5 6 7 |
# File 'lib/pagseguro/installment/response_serializer.rb', line 5 def xml @xml end |
Instance Method Details
#serialize ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/pagseguro/installment/response_serializer.rb', line 11 def serialize {}.tap do |data| data[:card_brand] = xml.css("cardBrand").text data[:quantity] = xml.css("quantity").text data[:amount] = xml.css("amount").text data[:total_amount] = xml.css("totalAmount").text data[:interest_free] = xml.css("interestFree").text end end |