Class: Ast::Merge::Runtime::Diagnostic
- Inherits:
-
Object
- Object
- Ast::Merge::Runtime::Diagnostic
- Defined in:
- lib/ast/merge/runtime/diagnostic.rb
Overview
Structured runtime event emitted during merge orchestration.
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#operation_id ⇒ Object
readonly
Returns the value of attribute operation_id.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#surface_path ⇒ Object
readonly
Returns the value of attribute surface_path.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(severity:, kind:, operation_id:, surface_path:, message:, metadata: {}) ⇒ Diagnostic
constructor
A new instance of Diagnostic.
- #to_h ⇒ Object
- #warning? ⇒ Boolean
Constructor Details
#initialize(severity:, kind:, operation_id:, surface_path:, message:, metadata: {}) ⇒ Diagnostic
Returns a new instance of Diagnostic.
10 11 12 13 14 15 16 17 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 10 def initialize(severity:, kind:, operation_id:, surface_path:, message:, metadata: {}) @severity = severity.to_sym @kind = kind.to_sym @operation_id = operation_id @surface_path = surface_path.to_s @message = .to_s @metadata = .dup.freeze end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
8 9 10 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 8 def kind @kind end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 8 def @message end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 8 def @metadata end |
#operation_id ⇒ Object (readonly)
Returns the value of attribute operation_id.
8 9 10 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 8 def operation_id @operation_id end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
8 9 10 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 8 def severity @severity end |
#surface_path ⇒ Object (readonly)
Returns the value of attribute surface_path.
8 9 10 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 8 def surface_path @surface_path end |
Instance Method Details
#error? ⇒ Boolean
19 20 21 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 19 def error? severity == :error end |
#to_h ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 27 def to_h { severity: severity, kind: kind, operation_id: operation_id, surface_path: surface_path, message: , metadata: } end |
#warning? ⇒ Boolean
23 24 25 |
# File 'lib/ast/merge/runtime/diagnostic.rb', line 23 def warning? severity == :warn end |