Class: RuboCop::Cop::Style::NestedModifier

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
RangeHelp
Defined in:
lib/rubocop/cop/style/nested_modifier.rb

Overview

Checks for nested use of if, unless, while and until in their modifier form.

Examples:


# bad
something if a if b

# good
something if b && a

Constant Summary collapse

MSG =
'Avoid using nested modifiers.'

Instance Method Summary collapse

Methods included from AutoCorrector

support_autocorrect?

Instance Method Details

#on_while(node) ⇒ Object Also known as: on_until, on_if



22
23
24
# File 'lib/rubocop/cop/style/nested_modifier.rb', line 22

def on_while(node)
  check(node)
end