Class: SandiMeter::LOCChecker

Inherits:
Struct
  • Object
show all
Defined in:
lib/sandi_meter/loc_checker.rb

Constant Summary collapse

MAX_LOC =
{
  'def'   => 5,
  'class' => 100
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#file_linesObject

Returns the value of attribute file_lines

Returns:

  • (Object)

    the current value of file_lines


2
3
4
# File 'lib/sandi_meter/loc_checker.rb', line 2

def file_lines
  @file_lines
end

Instance Method Details

#check(params, token) ⇒ Object


9
10
11
12
# File 'lib/sandi_meter/loc_checker.rb', line 9

def check(params, token)
  _, first_line, last_line = params
  locs_size(first_line, last_line) <= MAX_LOC[token]
end