Class: SlimLint::Reporter Abstract
- Inherits:
-
Object
- Object
- SlimLint::Reporter
- Defined in:
- lib/slim_lint/reporter.rb
Overview
Abstract lint reporter. Subclass and override #display_report to implement a custom lint reporter.
Direct Known Subclasses
CheckstyleReporter, DefaultReporter, EmacsReporter, GithubReporter, JsonReporter
Defined Under Namespace
Classes: CheckstyleReporter, DefaultReporter, EmacsReporter, GithubReporter, 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.
12 13 14 |
# File 'lib/slim_lint/reporter.rb', line 12 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.
28 29 30 |
# File 'lib/slim_lint/reporter.rb', line 28 def self.descendants @descendants ||= [] end |
.inherited(descendant) ⇒ Object
Executed when this class is subclassed.
35 36 37 |
# File 'lib/slim_lint/reporter.rb', line 35 def self.inherited(descendant) descendants << descendant end |
Instance Method Details
#display_report(report) ⇒ Object
Implemented by subclasses to display lints from a SlimLint::Report.
19 20 21 22 |
# File 'lib/slim_lint/reporter.rb', line 19 def display_report(report) raise NotImplementedError, "Implement `display_report` to display #{report}" end |