Class: Commons::Integrity::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/commons/integrity/report.rb

Overview

Collate the errors from all reports applying to a file

Instance Method Summary collapse

Constructor Details

#initialize(file:, config: nil) ⇒ Report

Returns a new instance of Report.



13
14
15
16
# File 'lib/commons/integrity/report.rb', line 13

def initialize(file:, config: nil)
  @file = Pathname.new(file)
  @config = config
end

Instance Method Details

#errorsObject



18
19
20
# File 'lib/commons/integrity/report.rb', line 18

def errors
  relevant_checks.flat_map { |check| check.new(file).errors }
end