class RuboCop::Cop::Style::EachWithObject
def accumulator_param_assigned_to?(body, args)
if the accumulator parameter is assigned to in the block,
def accumulator_param_assigned_to?(body, args) first_arg, = *args accumulator_var, = *first_arg body.each_descendant.any? do |n| next unless n.assignment? lhs, _rhs = *n lhs.equal?(accumulator_var) end end