Class: Rubocop::Cop::Style::EmptyLinesAroundBody

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/style/empty_lines_around_body.rb

Overview

This cops checks for two or more consecutive blank lines.

Constant Summary collapse

MSG_BEG =
'Extra blank line detected at body beginning.'
MSG_END =
'Extra blank line detected at body end.'

Constants inherited from Cop

Cop::OPERATOR_METHODS

Instance Attribute Summary

Attributes inherited from Cop

#config, #corrections, #offences, #processed_source

Instance Method Summary collapse

Methods inherited from Cop

#add_offence, all, #autocorrect?, #convention, #cop_config, cop_name, #cop_name, cop_type, #debug?, #ignore_node, inherited, #initialize, lint?, #message, non_rails, rails?, style?, #support_autocorrect?, #warning

Constructor Details

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

Instance Method Details

#on_class(node) ⇒ Object



11
12
13
# File 'lib/rubocop/cop/style/empty_lines_around_body.rb', line 11

def on_class(node)
  check_node(node)
end

#on_def(node) ⇒ Object



23
24
25
# File 'lib/rubocop/cop/style/empty_lines_around_body.rb', line 23

def on_def(node)
  check_node(node)
end

#on_defs(node) ⇒ Object



27
28
29
# File 'lib/rubocop/cop/style/empty_lines_around_body.rb', line 27

def on_defs(node)
  check_node(node)
end

#on_module(node) ⇒ Object



15
16
17
# File 'lib/rubocop/cop/style/empty_lines_around_body.rb', line 15

def on_module(node)
  check_node(node)
end

#on_sclass(node) ⇒ Object



19
20
21
# File 'lib/rubocop/cop/style/empty_lines_around_body.rb', line 19

def on_sclass(node)
  check_node(node)
end