Class: Roodi::Checks::NameCheck
- Defined in:
- lib/roodi/checks/name_check.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Check
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Instance Method Summary collapse
Methods inherited from Check
#add_error, #end_file, #errors, #evaluate_end, #evaluate_node, #evaluate_node_end, #evaluate_node_start, #initialize, make, #position, #start_file
Constructor Details
This class inherits a constructor from Roodi::Checks::Check
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
7 8 9 |
# File 'lib/roodi/checks/name_check.rb', line 7 def pattern @pattern end |
Instance Method Details
#evaluate_start(node) ⇒ Object
9 10 11 12 |
# File 'lib/roodi/checks/name_check.rb', line 9 def evaluate_start(node) name = find_name(node) add_error "#{} name \"#{name}\" should match pattern #{@pattern.inspect}" unless name.to_s =~ @pattern end |