class RuboCop::Cop::Lint::EachWithObjectArgument

sum = numbers.each_with_object(num) { |e, a| a += e }
num = 0
# good
@example
sum = numbers.each_with_object(0) { |e, a| a += e }
# bad
@example
It’s definitely a bug.
each_with_object iterates over, an immutable argument makes no sense.
make calls on to build something based on the enumerable that
argument. Since the argument is the object that the given block shall
This cop checks if each_with_object is called with an immutable

def on_send(node)

def on_send(node)
  each_with_object?(node) do |arg|
    return unless arg.immutable_literal?
    add_offense(node)
  end
end