lib/contracts/contract/validators.rb
TODO found Open
Open
# TODO: account for these errors too
- Exclude checks
Avoid comparing a variable with multiple items in a conditional, use Array#include?
instead. Open
Open
return :class if klass == Class || klass == Module
- Read upRead up
- Exclude checks
This cop checks against comparing a variable with multiple items, where
Array#include?
could be used instead to avoid code repetition.
Example:
# bad
a = 'a'
foo if a == 'a' || a == 'b' || a == 'c'
# good
a = 'a'
foo if ['a', 'b', 'c'].include?(a)