class RuboCop::Cop::Vendor::RollbarInterpolation
This cop checks for interpolated message when calling `Rollbar.error` and suggests sending extra fields as hash parameter instead.
The main reason for this suggestion is that Rollbar will have a harder time grouping messages that are dynamic.
@example
# bad Rollbar.error(e, "Unable to sync account #{account.id}") # good Rollbar.error(e, "Unable to sync account", account_id: account.id)
Constants
- MSG
Public Instance Methods
on_send(node)
click to toggle source
# File lib/rubocop/cop/vendor/rollbar_interpolation.rb, line 29 def on_send(node) interpolated_string = bad_method?(node) return unless interpolated_string add_offense(interpolated_string) end