Class: Bones::RPC::Adapter::JSON::Unpacker
- Inherits:
-
Object
- Object
- Bones::RPC::Adapter::JSON::Unpacker
- Defined in:
- lib/bones/rpc/adapter/json.rb
Overview
I apologize for how nasty this unpacker is; Oj or Yajl would be better fits
Constant Summary collapse
- ARRAY_START =
'['.freeze
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
Instance Method Summary collapse
-
#initialize(data) ⇒ Unpacker
constructor
A new instance of Unpacker.
- #read ⇒ Object
Constructor Details
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
38 39 40 |
# File 'lib/bones/rpc/adapter/json.rb', line 38 def buffer @buffer end |
Instance Method Details
#read ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/bones/rpc/adapter/json.rb', line 46 def read if skip_to_array_start unpack_stream("", buffer.pos) else nil end end |