Class: Pelusa::Lint::EvalUsage
- Inherits:
-
Object
- Object
- Pelusa::Lint::EvalUsage
- Defined in:
- lib/pelusa/lint/eval_usage.rb
Instance Method Summary collapse
- #check(klass) ⇒ Object
-
#initialize ⇒ EvalUsage
constructor
A new instance of EvalUsage.
Constructor Details
#initialize ⇒ EvalUsage
7 8 9 |
# File 'lib/pelusa/lint/eval_usage.rb', line 7 def initialize @violations = Set.new end |
Instance Method Details
#check(klass) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/pelusa/lint/eval_usage.rb', line 11 def check(klass) iterate_lines!(klass) if @violations.empty? SuccessfulAnalysis.new(name) else FailedAnalysis.new(name, @violations) do |violations| "There are #{violations.length} eval statement in lines #{violations.to_a.join(', ')}" end end end |