Class: Simplabs::Excellent::Checks::LineCountCheck
- Defined in:
- lib/simplabs/excellent/checks/line_count_check.rb
Overview
:nodoc:
Direct Known Subclasses
ClassLineCountCheck, MethodLineCountCheck, ModuleLineCountCheck
Instance Attribute Summary
Attributes inherited from Base
#interesting_contexts, #interesting_files, #options, #warnings
Instance Method Summary collapse
- #evaluate(context) ⇒ Object
-
#initialize(interesting_contexts, options = {}) ⇒ LineCountCheck
constructor
:nodoc:.
Methods inherited from Base
#add_warning, #evaluate_context, #warnings_for
Constructor Details
#initialize(interesting_contexts, options = {}) ⇒ LineCountCheck
:nodoc:
11 12 13 14 15 |
# File 'lib/simplabs/excellent/checks/line_count_check.rb', line 11 def initialize(interesting_contexts, = {}) #:nodoc: super() @interesting_contexts = interesting_contexts @threshold = [:threshold].to_i end |
Instance Method Details
#evaluate(context) ⇒ Object
17 18 19 |
# File 'lib/simplabs/excellent/checks/line_count_check.rb', line 17 def evaluate(context) add_warning(*warning_args(context)) unless context.line_count <= @threshold end |