Class: Thrift::Deserializer
- Inherits:
-
Object
- Object
- Thrift::Deserializer
- Defined in:
- lib/thrift/serializer/deserializer.rb
Instance Method Summary collapse
- #deserialize(base, buffer) ⇒ Object
-
#initialize(protocol_factory = BinaryProtocolFactory.new) ⇒ Deserializer
constructor
A new instance of Deserializer.
Constructor Details
#initialize(protocol_factory = BinaryProtocolFactory.new) ⇒ Deserializer
Returns a new instance of Deserializer.
22 23 24 25 |
# File 'lib/thrift/serializer/deserializer.rb', line 22 def initialize(protocol_factory = BinaryProtocolFactory.new) @transport = MemoryBufferTransport.new @protocol = protocol_factory.get_protocol(@transport) end |
Instance Method Details
#deserialize(base, buffer) ⇒ Object
27 28 29 30 31 |
# File 'lib/thrift/serializer/deserializer.rb', line 27 def deserialize(base, buffer) @transport.reset_buffer(buffer) base.read(@protocol) base end |