Class: SlimLint::Reporter Abstract
- Inherits:
-
Object
- Object
- SlimLint::Reporter
- Defined in:
- lib/slim_lint/reporter.rb
Overview
This class is abstract.
Abstract lint reporter. Subclass and override #display_report to implement a custom lint reporter.
Direct Known Subclasses
Defined Under Namespace
Classes: CheckstyleReporter, DefaultReporter, JsonReporter
Class Method Summary collapse
-
.descendants ⇒ Array<Class>
Keep tracking all the descendants of this class for the list of available reporters.
-
.inherited(descendant) ⇒ Object
Executed when this class is subclassed.
Instance Method Summary collapse
-
#display_report(report) ⇒ Object
Implemented by subclasses to display lints from a Report.
-
#initialize(logger) ⇒ Reporter
constructor
Creates the reporter that will display the given report.
Constructor Details
#initialize(logger) ⇒ Reporter
Creates the reporter that will display the given report.
10 11 12 |
# File 'lib/slim_lint/reporter.rb', line 10 def initialize(logger) @log = logger end |
Class Method Details
.descendants ⇒ Array<Class>
Keep tracking all the descendants of this class for the list of available reporters.
26 27 28 |
# File 'lib/slim_lint/reporter.rb', line 26 def self.descendants @descendants ||= [] end |
.inherited(descendant) ⇒ Object
Executed when this class is subclassed.
33 34 35 |
# File 'lib/slim_lint/reporter.rb', line 33 def self.inherited(descendant) descendants << descendant end |
Instance Method Details
#display_report(report) ⇒ Object
Implemented by subclasses to display lints from a SlimLint::Report.
17 18 19 20 |
# File 'lib/slim_lint/reporter.rb', line 17 def display_report(report) raise NotImplementedError, "Implement `display_report` to display #{report}" end |