Class: Rubocop::Cop::Style::ClassAndModuleCamelCase

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

Overview

This cops checks for class and module names with an underscore in them.

Constant Summary collapse

MSG =
'Use CamelCase for classes and modules.'

Instance Attribute Summary

Attributes inherited from Cop

#autocorrect, #corrections, #debug, #disabled_lines, #offences

Instance Method Summary collapse

Methods inherited from Cop

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

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/class_and_module_camel_case.rb', line 11

def on_class(node)
  check_name(node)
end

#on_module(node) ⇒ Object



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

def on_module(node)
  check_name(node)
end