Class: Roodi::Checks::LineCountCheck
- Defined in:
- lib/roodi/checks/line_count_check.rb
Overview
Checks how many lines there are in a ruby_parser node
Direct Known Subclasses
ClassLineCountCheck, MethodLineCountCheck, ModuleLineCountCheck
Constant Summary
Constants inherited from Check
Instance Attribute Summary collapse
-
#line_count ⇒ Object
Returns the value of attribute line_count.
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
#line_count ⇒ Object
Returns the value of attribute line_count.
8 9 10 |
# File 'lib/roodi/checks/line_count_check.rb', line 8 def line_count @line_count end |
Instance Method Details
#evaluate_start(node) ⇒ Object
10 11 12 13 |
# File 'lib/roodi/checks/line_count_check.rb', line 10 def evaluate_start(node) line_count = count_lines(node) add_error "#{} \"#{node[1]}\" has #{line_count} lines. It should have #{@line_count} or less." unless line_count <= @line_count end |