Unused method argument -
bar
. If it's necessary, use _
or _bar
as an argument name to indicate that it won't be used. If it's unnecessary, remove it. You can also write as some_method(*)
if you want the method to accept any arguments but don't care about them.28end
29
30# Raises "unused method arguments detected"
31def some_method(bar)32 puts 'Hello'
33end
34
Description
If an unused method argument is intended, it should be prefixed with an underscore.
Bad practice
def some_method(used, unused)
puts used
end
Recommended
def some_method(used, _unused)
puts used
end