Class: Rubocop::Cop::Lint::Loop

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/lint/loop.rb

Overview

This cop checks for uses of begin...end while/until something.

Constant Summary collapse

MSG =
'Use Kernel#loop with break rather than ' +
'begin/end/until(or while).'

Instance Attribute Summary

Attributes inherited from Cop

#autocorrect, #debug, #disabled_lines, #offences

Instance Method Summary collapse

Methods inherited from Cop

#add_offence, #autocorrect_action, cop_name, cop_type, #do_autocorrect, #ignore_node, inherited, #initialize, #inspect, lint?, #name, rails?, style?

Constructor Details

This class inherits a constructor from Rubocop::Cop::Cop

Instance Method Details

#on_until_post(node) ⇒ Object



16
17
18
19
# File 'lib/rubocop/cop/lint/loop.rb', line 16

def on_until_post(node)
  register_offence(node)
  super
end

#on_while_post(node) ⇒ Object



11
12
13
14
# File 'lib/rubocop/cop/lint/loop.rb', line 11

def on_while_post(node)
  register_offence(node)
  super
end