Class: PagSeguro::Authorization::RequestSerializer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ RequestSerializer

Returns a new instance of RequestSerializer.



6
7
8
# File 'lib/pagseguro/authorization/request_serializer.rb', line 6

def initialize(options)
  @options = options
end

Instance Attribute Details

#authorizationObject (readonly)

Returns the value of attribute authorization.



4
5
6
# File 'lib/pagseguro/authorization/request_serializer.rb', line 4

def authorization
  @authorization
end

Instance Method Details

#to_paramsObject



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

def to_params
  params[:credentials] = @options[:credentials] if @options[:credentials]
  params[:reference]   = @options[:reference] if @options[:reference]
  params[:initialDate] = @options[:initial_date].xmlschema if @options[:initial_date]
  params[:finalDate]   = @options[:final_date].xmlschema if @options[:final_date]
  params
end