Class: PagSeguro::SubscriptionCanceller::Response
- Inherits:
-
Object
- Object
- PagSeguro::SubscriptionCanceller::Response
- Defined in:
- lib/pagseguro/subscription_canceller/response.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Set the object that will receive errors or updates.
-
#response ⇒ Object
readonly
The http response.
Instance Method Summary collapse
-
#initialize(response, object) ⇒ Response
constructor
A new instance of Response.
- #serialize ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response, object) ⇒ Response
Returns a new instance of Response.
10 11 12 13 |
# File 'lib/pagseguro/subscription_canceller/response.rb', line 10 def initialize(response, object) @response = response @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Set the object that will receive errors or updates
8 9 10 |
# File 'lib/pagseguro/subscription_canceller/response.rb', line 8 def object @object end |
#response ⇒ Object (readonly)
The http response.
5 6 7 |
# File 'lib/pagseguro/subscription_canceller/response.rb', line 5 def response @response end |
Instance Method Details
#serialize ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/pagseguro/subscription_canceller/response.rb', line 15 def serialize unless success? object.errors.add response end object end |
#success? ⇒ Boolean
23 24 25 |
# File 'lib/pagseguro/subscription_canceller/response.rb', line 23 def success? response.success? && response.xml? end |