lib/matchers/validations/base_validation_matcher.rb
Unused method argument - symbol_name
. If it's necessary, use _
or _symbol_name
as an argument name to indicate that it won't be used. You can also write as with_if(*)
if you want the method to accept any arguments but don't care about them. Open
Open
def with_if(symbol_name)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Unused method argument - context
. If it's necessary, use _
or _context
as an argument name to indicate that it won't be used. You can also write as on(*)
if you want the method to accept any arguments but don't care about them. Open
Open
def on(context)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Unused method argument - value
. If it's necessary, use _
or _value
as an argument name to indicate that it won't be used. You can also write as allow_blank(*)
if you want the method to accept any arguments but don't care about them. Open
Open
def allow_blank(value = true)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Unused method argument - value
. If it's necessary, use _
or _value
as an argument name to indicate that it won't be used. You can also write as allow_nil(*)
if you want the method to accept any arguments but don't care about them. Open
Open
def allow_nil(value = true)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Unused method argument - value
. If it's necessary, use _
or _value
as an argument name to indicate that it won't be used. You can also write as strict(*)
if you want the method to accept any arguments but don't care about them. Open
Open
def strict(value)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Unused method argument - symbol_name
. If it's necessary, use _
or _symbol_name
as an argument name to indicate that it won't be used. You can also write as with_unless(*)
if you want the method to accept any arguments but don't care about them. Open
Open
def with_unless(symbol_name)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end