Class: PagSeguro::Session::ResponseSerializer
- Inherits:
-
Object
- Object
- PagSeguro::Session::ResponseSerializer
- Defined in:
- lib/pagseguro/session/response_serializer.rb
Instance Attribute Summary collapse
-
#xml ⇒ Object
readonly
The session that will be serialized.
Instance Method Summary collapse
-
#initialize(xml) ⇒ ResponseSerializer
constructor
A new instance of ResponseSerializer.
- #serialize ⇒ Object
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
#xml ⇒ Object (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
#serialize ⇒ Object
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 |