Class: Linterbot::LinterReport

Inherits:
Object
  • Object
show all
Defined in:
lib/linterbot/linter_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_file) ⇒ LinterReport

Returns a new instance of LinterReport.



10
11
12
# File 'lib/linterbot/linter_report.rb', line 10

def initialize(report_file)
  @report_file = report_file
end

Instance Attribute Details

#report_fileObject

Returns the value of attribute report_file.



8
9
10
# File 'lib/linterbot/linter_report.rb', line 8

def report_file
  @report_file
end

Instance Method Details

#hints_by_file(base_path) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/linterbot/linter_report.rb', line 18

def hints_by_file(base_path)
  hints_for_base_path(base_path).reduce(Hash.new) do |result, hint|
    hints_for_file = result[hint.file] ||= []
    hints_for_file << hint
    result
  end
end

#linter_reportObject



14
15
16
# File 'lib/linterbot/linter_report.rb', line 14

def linter_report
  @linter_report ||= JSON.parse(report_file_content)
end