Class: Pelusa::Lint::LineRestriction

Inherits:
Object
  • Object
show all
Defined in:
lib/pelusa/lint/line_restriction.rb

Instance Method Summary collapse

Constructor Details

#initializeLineRestriction

Returns a new instance of LineRestriction


4
5
6
# File 'lib/pelusa/lint/line_restriction.rb', line 4

def initialize
  @lines = Set.new
end

Instance Method Details

#check(klass) ⇒ Object


8
9
10
11
12
13
14
15
16
# File 'lib/pelusa/lint/line_restriction.rb', line 8

def check(klass)
  iterate_lines!(klass)

  return SuccessfulAnalysis.new(name) if lines < limit

  FailedAnalysis.new(name, lines) do |lines|
    "This class has #{lines} lines."
  end
end