Class: Rubocop::Cop::ClassMethods
- Defined in:
- lib/rubocop/cop/class_methods.rb
Constant Summary collapse
- MSG =
'Prefer self over class/module for class/module methods.'
Instance Attribute Summary
Attributes inherited from Cop
#debug, #disabled_lines, #offences
Instance Method Summary collapse
Methods inherited from Cop
#add_offence, cop_name, #has_report?, #ignore_node, inherited, #initialize, #inspect, #name
Constructor Details
This class inherits a constructor from Rubocop::Cop::Cop
Instance Method Details
#on_defs(node) ⇒ Object
8 9 10 11 12 |
# File 'lib/rubocop/cop/class_methods.rb', line 8 def on_defs(node) definee, _name, _args, _body = *node add_offence(:convention, node.loc.line, MSG) if definee.type == :const end |