lib/pelusa/lint/line_restriction.rb in pelusa-0.2.2 vs lib/pelusa/lint/line_restriction.rb in pelusa-0.2.3
- old
+ new
@@ -4,11 +4,10 @@
def initialize
@lines = Set.new
end
def check(klass)
- initialize
iterate_lines!(klass)
return SuccessfulAnalysis.new(name) if lines < limit
FailedAnalysis.new(name, lines) do |lines|
@@ -29,13 +28,12 @@
def lines
@lines.max - @lines.min
end
def iterate_lines!(klass)
- iterator = Iterator.new do |node|
+ ClassAnalyzer.walk(klass) do |node|
@lines << node.line if node.respond_to?(:line)
end
- Array(klass).each(&iterator)
end
end
end
end