Class: Flexr::Diagnostic
- Inherits:
-
Struct
- Object
- Struct
- Flexr::Diagnostic
- Defined in:
- lib/flexr/diagnostics.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#help ⇒ Object
Returns the value of attribute help.
-
#location ⇒ Object
Returns the value of attribute location.
-
#message ⇒ Object
Returns the value of attribute message.
-
#note ⇒ Object
Returns the value of attribute note.
-
#severity ⇒ Object
Returns the value of attribute severity.
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
4 5 6 |
# File 'lib/flexr/diagnostics.rb', line 4 def code @code end |
#help ⇒ Object
Returns the value of attribute help
4 5 6 |
# File 'lib/flexr/diagnostics.rb', line 4 def help @help end |
#location ⇒ Object
Returns the value of attribute location
4 5 6 |
# File 'lib/flexr/diagnostics.rb', line 4 def location @location end |
#message ⇒ Object
Returns the value of attribute message
4 5 6 |
# File 'lib/flexr/diagnostics.rb', line 4 def @message end |
#note ⇒ Object
Returns the value of attribute note
4 5 6 |
# File 'lib/flexr/diagnostics.rb', line 4 def note @note end |
#severity ⇒ Object
Returns the value of attribute severity
4 5 6 |
# File 'lib/flexr/diagnostics.rb', line 4 def severity @severity end |
Instance Method Details
#error? ⇒ Boolean
5 6 7 |
# File 'lib/flexr/diagnostics.rb', line 5 def error? severity == :error end |
#to_h ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/flexr/diagnostics.rb', line 13 def to_h { code: code, severity: severity, message: , location: location, help: help, note: note }.compact end |
#warning? ⇒ Boolean
9 10 11 |
# File 'lib/flexr/diagnostics.rb', line 9 def warning? severity == :warning end |