Class: PagSeguro::Installment::RequestSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/pagseguro/installment/request_serializer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ RequestSerializer

Returns a new instance of RequestSerializer.



7
8
9
# File 'lib/pagseguro/installment/request_serializer.rb', line 7

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

The data that will be serialized.



5
6
7
# File 'lib/pagseguro/installment/request_serializer.rb', line 5

def data
  @data
end

Instance Method Details

#to_paramsObject



11
12
13
14
15
16
# File 'lib/pagseguro/installment/request_serializer.rb', line 11

def to_params
  params[:amount] = data[:amount]
  params[:cardBrand] = data[:card_brand] if data[:card_brand]

  params
end