Class: Roodi::Checks::NameCheck
- Defined in:
- lib/roodi/checks/name_check.rb
Direct Known Subclasses
Instance Method Summary collapse
- #evaluate(node) ⇒ Object
-
#initialize(interesting_nodes, pattern, message_prefix) ⇒ NameCheck
constructor
A new instance of NameCheck.
- #interesting_nodes ⇒ Object
Methods inherited from Check
#add_error, #errors, #evaluate_node_at_line, #position
Constructor Details
#initialize(interesting_nodes, pattern, message_prefix) ⇒ NameCheck
Returns a new instance of NameCheck.
9 10 11 12 13 14 |
# File 'lib/roodi/checks/name_check.rb', line 9 def initialize(interesting_nodes, pattern, ) super() @interesting_nodes = interesting_nodes @pattern = pattern @message_prefix = end |
Instance Method Details
#evaluate(node) ⇒ Object
20 21 22 23 |
# File 'lib/roodi/checks/name_check.rb', line 20 def evaluate(node) name = find_name(node) add_error((node)) unless name.to_s =~ @pattern end |
#interesting_nodes ⇒ Object
16 17 18 |
# File 'lib/roodi/checks/name_check.rb', line 16 def interesting_nodes @interesting_nodes end |