Class: LintTrappings::Lint
- Inherits:
-
Object
- Object
- LintTrappings::Lint
- Defined in:
- lib/lint_trappings/lint.rb
Overview
Contains information about a problem or issue with a document.
Instance Attribute Summary collapse
-
#exception ⇒ Exception
readonly
The exception that was raised, if any.
-
#linter ⇒ LintTrappings::Linter?
readonly
Linter that reported the lint (if applicable).
-
#message ⇒ String
readonly
Message describing the lint.
-
#path ⇒ String
readonly
File path to which the lint applies.
-
#severity ⇒ Symbol
readonly
Whether this lint is a warning or an error.
-
#source_range ⇒ Range<LintTrappings::Location>
readonly
Source range of the problem within the file.
Instance Method Summary collapse
-
#initialize(options) ⇒ Lint
constructor
A new instance of Lint.
Constructor Details
#initialize(options) ⇒ Lint
Returns a new instance of Lint.
28 29 30 31 32 33 34 35 |
# File 'lib/lint_trappings/lint.rb', line 28 def initialize() @linter = [:linter] @path = .fetch(:path) @source_range = .fetch(:source_range) @message = .fetch(:message) @severity = .fetch(:severity) @exception = [:exception] end |
Instance Attribute Details
#exception ⇒ Exception (readonly)
Returns the exception that was raised, if any.
20 21 22 |
# File 'lib/lint_trappings/lint.rb', line 20 def exception @exception end |
#linter ⇒ LintTrappings::Linter? (readonly)
Returns linter that reported the lint (if applicable).
5 6 7 |
# File 'lib/lint_trappings/lint.rb', line 5 def linter @linter end |
#message ⇒ String (readonly)
Returns message describing the lint.
14 15 16 |
# File 'lib/lint_trappings/lint.rb', line 14 def @message end |
#path ⇒ String (readonly)
Returns file path to which the lint applies.
8 9 10 |
# File 'lib/lint_trappings/lint.rb', line 8 def path @path end |
#severity ⇒ Symbol (readonly)
Returns whether this lint is a warning or an error.
17 18 19 |
# File 'lib/lint_trappings/lint.rb', line 17 def severity @severity end |
#source_range ⇒ Range<LintTrappings::Location> (readonly)
Returns source range of the problem within the file.
11 12 13 |
# File 'lib/lint_trappings/lint.rb', line 11 def source_range @source_range end |