Class: Lintron::ViolationLine

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/lintron/api.rb

Overview

Represents one line of the lint results. Exists so that (1) We can use dot syntax to access members instead of [] (2) I can define file_and_line which is used for display and sorting

Instance Method Summary collapse

Instance Method Details

#file_and_line(padTo = 0) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/lintron/api.rb', line 45

def file_and_line(padTo = 0)
  file_and_line = "#{path}:#{format '%03i', line}    "

  if padTo > file_and_line.length
    file_and_line += ' ' * (padTo - file_and_line.length)
  end

  file_and_line
end