Class: PagSeguro::Session::ResponseSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/pagseguro/session/response_serializer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ ResponseSerializer

Returns a new instance of ResponseSerializer.



7
8
9
# File 'lib/pagseguro/session/response_serializer.rb', line 7

def initialize(xml)
  @xml = xml
end

Instance Attribute Details

#xmlObject (readonly)

The session that will be serialized



5
6
7
# File 'lib/pagseguro/session/response_serializer.rb', line 5

def xml
  @xml
end

Instance Method Details

#serializeObject



11
12
13
14
15
# File 'lib/pagseguro/session/response_serializer.rb', line 11

def serialize
  {}.tap do |data|
    data[:id] = xml.css("id").text
  end
end