class RuboCop::Cop::Performance::RegexpMatch
def replace_with_match_predicate_method(corrector, recv, arg, op_range)
def replace_with_match_predicate_method(corrector, recv, arg, op_range) if TYPES_IMPLEMENTING_MATCH.include?(recv.type) corrector.replace(op_range, '.match?(') elsif TYPES_IMPLEMENTING_MATCH.include?(arg.type) corrector.replace(op_range, '.match?(') swap_receiver_and_arg(corrector, recv, arg) else corrector.replace(op_range, '&.match?(') end end