lib/rubocop/cop/lint/redundant_with_object.rb in rubocop-0.76.0 vs lib/rubocop/cop/lint/redundant_with_object.rb in rubocop-0.77.0
- old
+ new
@@ -49,11 +49,11 @@
end
def autocorrect(node)
lambda do |corrector|
redundant_with_object?(node) do |send|
- if send.method_name == :each_with_object
+ if send.method?(:each_with_object)
corrector.replace(with_object_range(send), 'each')
else
corrector.remove(with_object_range(send))
corrector.remove(send.loc.dot)
end
@@ -62,10 +62,10 @@
end
private
def message(node)
- if node.method_name == :each_with_object
+ if node.method?(:each_with_object)
MSG_EACH_WITH_OBJECT
else
MSG_WITH_OBJECT
end
end