Class: PagSeguro::TransactionCancellation::RequestSerializer
- Inherits:
-
Object
- Object
- PagSeguro::TransactionCancellation::RequestSerializer
- Defined in:
- lib/pagseguro/transaction_cancellation/request_serializer.rb
Instance Attribute Summary collapse
-
#transaction_cancellation ⇒ Object
readonly
The transaction_cancellation that will be serialized.
Instance Method Summary collapse
-
#initialize(transaction_cancellation) ⇒ RequestSerializer
constructor
A new instance of RequestSerializer.
- #to_params ⇒ Object
Constructor Details
#initialize(transaction_cancellation) ⇒ RequestSerializer
Returns a new instance of RequestSerializer.
7 8 9 |
# File 'lib/pagseguro/transaction_cancellation/request_serializer.rb', line 7 def initialize(transaction_cancellation) @transaction_cancellation = transaction_cancellation end |
Instance Attribute Details
#transaction_cancellation ⇒ Object (readonly)
The transaction_cancellation that will be serialized.
5 6 7 |
# File 'lib/pagseguro/transaction_cancellation/request_serializer.rb', line 5 def transaction_cancellation @transaction_cancellation end |
Instance Method Details
#to_params ⇒ Object
11 12 13 14 15 |
# File 'lib/pagseguro/transaction_cancellation/request_serializer.rb', line 11 def to_params {}.tap do |data| data[:transactionCode] = transaction_cancellation.transaction_code end.delete_if { |_, value| value.nil? } end |