Class: Bones::RPC::Adapter::Erlang::Unpacker

Inherits:
Object
  • Object
show all
Defined in:
lib/bones/rpc/adapter/erlang.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Unpacker

Returns a new instance of Unpacker.



55
56
57
# File 'lib/bones/rpc/adapter/erlang.rb', line 55

def initialize(data)
  @buffer = Bones::RPC::Parser::Buffer.new(data)
end

Instance Attribute Details

#bufferObject (readonly)

Returns the value of attribute buffer.



53
54
55
# File 'lib/bones/rpc/adapter/erlang.rb', line 53

def buffer
  @buffer
end

Instance Method Details

#readObject



59
60
61
62
63
64
# File 'lib/bones/rpc/adapter/erlang.rb', line 59

def read
  ext_data = Adapter.read_ext(buffer)
  ::Erlang.binary_to_term(ext_data)
rescue NotImplementedError
  nil
end