Class: PagSeguro::Installment::Response
- Inherits:
-
Object
- Object
- PagSeguro::Installment::Response
- Defined in:
- lib/pagseguro/installment/response.rb
Instance Method Summary collapse
-
#initialize(response, collection) ⇒ Response
constructor
A new instance of Response.
- #serialize ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response, collection) ⇒ Response
Returns a new instance of Response.
4 5 6 7 |
# File 'lib/pagseguro/installment/response.rb', line 4 def initialize(response, collection) @response = response @collection = collection end |
Instance Method Details
#serialize ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/pagseguro/installment/response.rb', line 9 def serialize if success? collection.installments = serialize_installments else collection.errors.add(response) end collection end |
#success? ⇒ Boolean
19 20 21 |
# File 'lib/pagseguro/installment/response.rb', line 19 def success? response.success? && response.xml? end |