Class: PagSeguro::AuthorizationRequest::RequestSerializer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ RequestSerializer

Returns a new instance of RequestSerializer.



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

def initialize(request)
  @request = request
  @builder = Nokogiri::XML::Builder
end

Instance Attribute Details

#requestObject

Returns the value of attribute request.



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

def request
  @request
end

Instance Method Details

#build_xmlObject



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

def build_xml
  build.to_xml(save_with:
    Nokogiri::XML::Node::SaveOptions::NO_EMPTY_TAGS |
    Nokogiri::XML::Node::SaveOptions::FORMAT
  )
end