lib/simplabs/excellent/checks/flog_check.rb in excellent-1.7.2 vs lib/simplabs/excellent/checks/flog_check.rb in excellent-2.0.0
- old
+ new
@@ -6,13 +6,13 @@
module Checks
class FlogCheck < Base #:nodoc:
- def initialize(interesting_contexts, threshold)
- super()
+ def initialize(interesting_contexts, options = {}) #:nodoc:
+ super(options)
@interesting_contexts = interesting_contexts
- @threshold = threshold
+ @threshold = options[:threshold].to_i
end
def evaluate(context)
add_warning(*warning_args(context)) unless context.flog_score <= @threshold
end