Class: Linterbot::LinterReport
- Inherits:
-
Object
- Object
- Linterbot::LinterReport
- Defined in:
- lib/linterbot/linter_report.rb
Instance Attribute Summary collapse
-
#report_file ⇒ Object
Returns the value of attribute report_file.
Instance Method Summary collapse
- #hints_by_file(base_path) ⇒ Object
-
#initialize(report_file) ⇒ LinterReport
constructor
A new instance of LinterReport.
- #linter_report ⇒ Object
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_file ⇒ Object
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_report ⇒ Object
14 15 16 |
# File 'lib/linterbot/linter_report.rb', line 14 def linter_report @linter_report ||= JSON.parse(report_file_content) end |