module Rollbar::Truncation::Mixin

Public Instance Methods

dump(payload) click to toggle source
# File lib/rollbar/truncation/mixin.rb, line 4
def dump(payload)
  Rollbar::JSON.dump(payload)
end
select_frames(frames, range = 50) click to toggle source
# File lib/rollbar/truncation/mixin.rb, line 12
def select_frames(frames, range = 50)
  return frames unless frames.count > range * 2

  frames[0, range] + frames[-range, range]
end
truncate?(result) click to toggle source
# File lib/rollbar/truncation/mixin.rb, line 8
def truncate?(result)
  result.bytesize > MAX_PAYLOAD_SIZE
end