module Datadog::Encoding::MsgpackEncoder
Encoder
for the Msgpack format
Constants
- CONTENT_TYPE
Public Instance Methods
content_type()
click to toggle source
# File lib/ddtrace/encoding.rb, line 56 def content_type CONTENT_TYPE end
encode(obj)
click to toggle source
# File lib/ddtrace/encoding.rb, line 60 def encode(obj) MessagePack.pack(obj) end
join(encoded_data)
click to toggle source
# File lib/ddtrace/encoding.rb, line 64 def join(encoded_data) packer = MessagePack::Packer.new packer.write_array_header(encoded_data.size) (packer.buffer.to_a + encoded_data).join end