Class: Thrift::Deserializer

Inherits:
Object
  • Object
show all
Defined in:
lib/thrift/serializer/deserializer.rb

Instance Method Summary collapse

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