Class: RuboCop::Cop::Commissioner::InvestigationReport
- Inherits:
-
Struct
- Object
- Struct
- RuboCop::Cop::Commissioner::InvestigationReport
- Defined in:
- lib/rubocop/cop/commissioner.rb
Overview
How a Commissioner returns the results of the investigation as a list of Cop::InvestigationReport and any errors caught during the investigation. Immutable Consider creation API private
Instance Attribute Summary collapse
-
#cop_reports ⇒ Object
Returns the value of attribute cop_reports.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#processed_source ⇒ Object
Returns the value of attribute processed_source.
Instance Method Summary collapse
- #cops ⇒ Object
- #correctors ⇒ Object
- #merge(investigation) ⇒ Object
- #offenses ⇒ Object
- #offenses_per_cop ⇒ Object
Instance Attribute Details
#cop_reports ⇒ Object
Returns the value of attribute cop_reports
18 19 20 |
# File 'lib/rubocop/cop/commissioner.rb', line 18 def cop_reports @cop_reports end |
#errors ⇒ Object
Returns the value of attribute errors
18 19 20 |
# File 'lib/rubocop/cop/commissioner.rb', line 18 def errors @errors end |
#processed_source ⇒ Object
Returns the value of attribute processed_source
18 19 20 |
# File 'lib/rubocop/cop/commissioner.rb', line 18 def processed_source @processed_source end |
Instance Method Details
#cops ⇒ Object
19 20 21 |
# File 'lib/rubocop/cop/commissioner.rb', line 19 def cops @cops ||= cop_reports.map(&:cop) end |
#correctors ⇒ Object
27 28 29 |
# File 'lib/rubocop/cop/commissioner.rb', line 27 def correctors @correctors ||= cop_reports.map(&:corrector) end |
#merge(investigation) ⇒ Object
35 36 37 38 39 |
# File 'lib/rubocop/cop/commissioner.rb', line 35 def merge(investigation) InvestigationReport.new(processed_source, cop_reports + investigation.cop_reports, errors + investigation.errors) end |
#offenses ⇒ Object
31 32 33 |
# File 'lib/rubocop/cop/commissioner.rb', line 31 def offenses @offenses ||= offenses_per_cop.flatten(1) end |
#offenses_per_cop ⇒ Object
23 24 25 |
# File 'lib/rubocop/cop/commissioner.rb', line 23 def offenses_per_cop @offenses_per_cop ||= cop_reports.map(&:offenses) end |