Module: Datadog::Encoding::JSONEncoder

Extended by:
Encoder
Defined in:
lib/ddtrace/encoding.rb

Overview

Encoder for the JSON format

Constant Summary collapse

CONTENT_TYPE =
'application/json'.freeze

Class Method Summary collapse

Class Method Details

.content_typeObject



35
36
37
# File 'lib/ddtrace/encoding.rb', line 35

def content_type
  CONTENT_TYPE
end

.encode(obj) ⇒ Object



39
40
41
# File 'lib/ddtrace/encoding.rb', line 39

def encode(obj)
  JSON.dump(obj)
end

.join(encoded_data) ⇒ Object



43
44
45
# File 'lib/ddtrace/encoding.rb', line 43

def join(encoded_data)
  "[#{encoded_data.join(',')}]"
end