Class: Roodi::Checks::ModuleNameCheck
- Defined in:
- lib/roodi/checks/module_name_check.rb
Overview
Checks a module name to make sure it matches the specified pattern.
Keeping to a consistent nameing convention makes your code easier to read.
Constant Summary collapse
- DEFAULT_PATTERN =
/^[A-Z][a-zA-Z0-9]*$/
Constants inherited from Check
Instance Attribute Summary
Attributes inherited from NameCheck
Instance Method Summary collapse
-
#initialize ⇒ ModuleNameCheck
constructor
A new instance of ModuleNameCheck.
- #interesting_nodes ⇒ Object
- #message_prefix ⇒ Object
Methods inherited from NameCheck
Methods inherited from Check
#add_error, #end_file, #errors, #evaluate_end, #evaluate_node, #evaluate_node_end, #evaluate_node_start, #evaluate_start, make, #position, #start_file
Constructor Details
#initialize ⇒ ModuleNameCheck
Returns a new instance of ModuleNameCheck.
12 13 14 15 |
# File 'lib/roodi/checks/module_name_check.rb', line 12 def initialize super() self.pattern = DEFAULT_PATTERN end |
Instance Method Details
#interesting_nodes ⇒ Object
17 18 19 |
# File 'lib/roodi/checks/module_name_check.rb', line 17 def interesting_nodes [:module] end |
#message_prefix ⇒ Object
21 22 23 |
# File 'lib/roodi/checks/module_name_check.rb', line 21 def 'Module' end |