class PagSeguro::SubscriptionCanceller::Response
Attributes
object[R]
Set the object that will receive errors or updates
response[R]
The http response.
Public Class Methods
new(response, object)
click to toggle source
# File lib/pagseguro/subscription_canceller/response.rb, line 10 def initialize(response, object) @response = response @object = object end
Public Instance Methods
serialize()
click to toggle source
# File lib/pagseguro/subscription_canceller/response.rb, line 15 def serialize unless success? object.errors.add response end object end
success?()
click to toggle source
# File lib/pagseguro/subscription_canceller/response.rb, line 23 def success? response.success? && response.xml? end
Private Instance Methods
xml()
click to toggle source
# File lib/pagseguro/subscription_canceller/response.rb, line 29 def xml Nokogiri::XML(response.body) end