class RuboCop::Cop::Style::NegatedWhile

Checks for uses of while with a negated condition.

Constants

MSG

Public Instance Methods

message(node) click to toggle source
# File lib/rubocop/cop/style/negated_while.rb, line 20
def message(node)
  format(MSG, node.inverse_keyword, node.keyword)
end
on_until(node) click to toggle source
# File lib/rubocop/cop/style/negated_while.rb, line 16
def on_until(node)
  check_negative_conditional(node)
end
on_while(node) click to toggle source
# File lib/rubocop/cop/style/negated_while.rb, line 12
def on_while(node)
  check_negative_conditional(node)
end

Private Instance Methods

autocorrect(node) click to toggle source
# File lib/rubocop/cop/style/negated_while.rb, line 26
def autocorrect(node)
  negative_conditional_corrector(node)
end