Class: Rubocop::Cop::FavorUnlessOverNegatedIf
- Includes:
- FavorOtherKeywordOverNegation
- Defined in:
- lib/rubocop/cop/favor_unless_over_negated_if.rb
Instance Attribute Summary
Attributes inherited from Cop
#correlations, #debug, #disabled_lines, #offences
Instance Method Summary collapse
Methods inherited from Cop
#add_offence, cop_name, #has_report?, inherited, #initialize, #name
Constructor Details
This class inherits a constructor from Rubocop::Cop::Cop
Instance Method Details
#error_message ⇒ Object
26 27 28 |
# File 'lib/rubocop/cop/favor_unless_over_negated_if.rb', line 26 def 'Favor unless (or control flow or) over if for negative conditions.' end |
#inspect(file, source, tokens, sexp) ⇒ Object
30 31 32 |
# File 'lib/rubocop/cop/favor_unless_over_negated_if.rb', line 30 def inspect(file, source, tokens, sexp) [:if, :if_mod].each { |grammar_part| check(grammar_part, sexp) } end |