Class: Roodi::Checks::ClassNameCheck
- Defined in:
- lib/roodi/checks/class_name_check.rb
Overview
Checks a class name to make sure it matches the specified pattern.
Keeping to a consistent naming convention makes your code easier to read.
Constant Summary collapse
- DEFAULT_PATTERN =
/^[A-Z][a-zA-Z0-9]*$/
Constants inherited from Check
Roodi::Checks::Check::NODE_TYPES
Instance Attribute Summary
Attributes inherited from NameCheck
Instance Method Summary collapse
-
#initialize ⇒ ClassNameCheck
constructor
A new instance of ClassNameCheck.
- #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 ⇒ ClassNameCheck
Returns a new instance of ClassNameCheck.
12 13 14 15 |
# File 'lib/roodi/checks/class_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/class_name_check.rb', line 17 def interesting_nodes [:class] end |
#message_prefix ⇒ Object
21 22 23 |
# File 'lib/roodi/checks/class_name_check.rb', line 21 def 'Class' end |