class RuboCop::Cop::Performance::RedundantEqualityComparisonBlock
def on_block(node)
def on_block(node) return unless TARGET_METHODS.include?(node.method_name) return unless one_block_argument?(node.arguments) block_argument = node.first_argument return unless (block_body = node.body) return unless use_equality_comparison_block?(block_body) return if same_block_argument_and_is_a_argument?(block_body, block_argument) return unless (new_argument = new_argument(block_argument, block_body)) range = offense_range(node) prefer = "#{node.method_name}(#{new_argument})" add_offense(range, message: format(MSG, prefer: prefer)) do |corrector| corrector.replace(range, prefer) end end