Class: Jade::Diagnostics::Diagnostic
- Inherits:
-
Data
- Object
- Data
- Jade::Diagnostics::Diagnostic
- Defined in:
- lib/jade/diagnostics.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#primary ⇒ Object
readonly
Returns the value of attribute primary.
-
#secondary ⇒ Object
readonly
Returns the value of attribute secondary.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
Class Method Summary collapse
- .error(message, primary:, secondary: [], annotations: []) ⇒ Object
- .warning(message, primary:, secondary: [], annotations: []) ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations
8 9 10 |
# File 'lib/jade/diagnostics.rb', line 8 def annotations @annotations end |
#message ⇒ Object (readonly)
Returns the value of attribute message
8 9 10 |
# File 'lib/jade/diagnostics.rb', line 8 def @message end |
#primary ⇒ Object (readonly)
Returns the value of attribute primary
8 9 10 |
# File 'lib/jade/diagnostics.rb', line 8 def primary @primary end |
#secondary ⇒ Object (readonly)
Returns the value of attribute secondary
8 9 10 |
# File 'lib/jade/diagnostics.rb', line 8 def secondary @secondary end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
8 9 10 |
# File 'lib/jade/diagnostics.rb', line 8 def severity @severity end |
Class Method Details
.error(message, primary:, secondary: [], annotations: []) ⇒ Object
9 10 11 |
# File 'lib/jade/diagnostics.rb', line 9 def self.error(, primary:, secondary: [], annotations: []) new(severity: :error, message:, primary:, secondary:, annotations:) end |
.warning(message, primary:, secondary: [], annotations: []) ⇒ Object
13 14 15 |
# File 'lib/jade/diagnostics.rb', line 13 def self.warning(, primary:, secondary: [], annotations: []) new(severity: :warning, message:, primary:, secondary:, annotations:) end |
Instance Method Details
#annotate(kind, text) ⇒ Object
21 22 23 |
# File 'lib/jade/diagnostics.rb', line 21 def annotate(kind, text) with(annotations: annotations + [Annotation[kind, text]]) end |
#error? ⇒ Boolean
17 18 19 |
# File 'lib/jade/diagnostics.rb', line 17 def error? severity == :error end |