Sha256: 02e7279558fc82d69f9f2e41c5bcde8edb1db1027b915f45cc5078414c612ec4
Contents?: true
Size: 516 Bytes
Versions: 9
Compression:
Stored size: 516 Bytes
Contents
# frozen_string_literal: true module Sentry # @api private class Envelope def initialize(headers) @headers = headers @items = [] end def add_item(headers, payload) @items << [headers, payload] end def to_s payload = @items.map do |item_headers, item_payload| <<~ENVELOPE #{JSON.generate(item_headers)} #{JSON.generate(item_payload)} ENVELOPE end.join("\n") "#{JSON.generate(@headers)}\n#{payload}" end end end
Version data entries
9 entries across 9 versions & 1 rubygems