class PagSeguro::SubscriptionPaymentOrder::Response
Attributes
object[R]
response[R]
Public Class Methods
new(response, object)
click to toggle source
# File lib/pagseguro/subscription_payment_order/response.rb, line 4 def initialize(response, object) @response = response @object = object end
Public Instance Methods
serialize()
click to toggle source
# File lib/pagseguro/subscription_payment_order/response.rb, line 9 def serialize if success? object.update_attributes serialized_data else object.errors.add response end object end
success?()
click to toggle source
# File lib/pagseguro/subscription_payment_order/response.rb, line 19 def success? response.success? && response.xml? end
Private Instance Methods
serialized_data()
click to toggle source
# File lib/pagseguro/subscription_payment_order/response.rb, line 28 def serialized_data ResponseSerializer.new(xml).serialize end
xml()
click to toggle source
# File lib/pagseguro/subscription_payment_order/response.rb, line 32 def xml Nokogiri::XML(response.data) end