class RuboCop::Cop::Performance::RedundantStringChars
def on_send(node)
def on_send(node) return unless (receiver, method, args = redundant_chars_call?(node)) return if method == :last && !args.empty? range = offense_range(receiver, node) message = build_message(method, args) add_offense(range, message: message) do |corrector| range = correction_range(receiver, node) replacement = build_good_method(method, args) corrector.replace(range, replacement) end end