class Rollbar::Truncation::RemoveExtraStrategy

Public Class Methods

call(payload) click to toggle source
# File lib/rollbar/truncation/remove_extra_strategy.rb, line 8
def self.call(payload)
  new.call(payload)
end

Public Instance Methods

call(payload) click to toggle source
# File lib/rollbar/truncation/remove_extra_strategy.rb, line 12
def call(payload)
  body = payload['data']['body']

  delete_message_extra(body)
  delete_trace_chain_extra(body)
  delete_trace_extra(body)

  dump(payload)
end
delete_message_extra(body) click to toggle source
# File lib/rollbar/truncation/remove_extra_strategy.rb, line 22
def delete_message_extra(body)
  body['message'].delete('extra') if body['message'] && body['message']['extra']
end
delete_trace_chain_extra(body) click to toggle source
# File lib/rollbar/truncation/remove_extra_strategy.rb, line 26
def delete_trace_chain_extra(body)
  return unless body['trace_chain'] && body['trace_chain'][0]['extra']

  body['trace_chain'][0].delete('extra')
end
delete_trace_extra(body) click to toggle source
# File lib/rollbar/truncation/remove_extra_strategy.rb, line 32
def delete_trace_extra(body)
  body['trace'].delete('extra') if body['trace'] && body['trace']['extra']
end