Class: Transit::Unmarshaler::MessagePack Private
- Inherits:
-
Object
- Object
- Transit::Unmarshaler::MessagePack
- Defined in:
- lib/transit/unmarshaler/cruby/messagepack.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(io, opts) ⇒ MessagePack
constructor
private
A new instance of MessagePack.
- #read ⇒ Object private
Constructor Details
#initialize(io, opts) ⇒ MessagePack
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MessagePack.
24 25 26 27 |
# File 'lib/transit/unmarshaler/cruby/messagepack.rb', line 24 def initialize(io, opts) @decoder = Transit::Decoder.new(opts) @unpacker = ::MessagePack::Unpacker.new(io) end |
Instance Method Details
#read ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 33 34 35 36 |
# File 'lib/transit/unmarshaler/cruby/messagepack.rb', line 30 def read if block_given? @unpacker.each {|v| yield @decoder.decode(v)} else @decoder.decode(@unpacker.read) end end |