Class: PagSeguro::Subscription::RequestSerializer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ RequestSerializer

Returns a new instance of RequestSerializer.



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

def initialize(object)
  @object = object
end

Instance Attribute Details

#objectObject (readonly)

Get the object



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

def object
  @object
end

Instance Method Details

#serializeObject



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

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