Class: Ibex::Runtime::SyntaxSessionDiagnostic
- Inherits:
-
Object
- Object
- Ibex::Runtime::SyntaxSessionDiagnostic
- Defined in:
- lib/ibex/runtime/syntax_session.rb
Overview
Immutable, data-only copy of one parser diagnostic. Application-owned values and locations are sanitized rather than retained by identity.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
: Hash[String, EventSanitizer::json_value].
-
#kind ⇒ Object
readonly
: Symbol.
Instance Method Summary collapse
-
#initialize(kind:, data:) ⇒ SyntaxSessionDiagnostic
constructor
A new instance of SyntaxSessionDiagnostic.
- #to_h ⇒ Object
Constructor Details
#initialize(kind:, data:) ⇒ SyntaxSessionDiagnostic
Returns a new instance of SyntaxSessionDiagnostic.
150 151 152 153 154 155 156 157 |
# File 'lib/ibex/runtime/syntax_session.rb', line 150 def initialize(kind:, data:) raise ArgumentError, "diagnostic kind must be a Symbol" unless kind.is_a?(Symbol) raise ArgumentError, "diagnostic data must be a Hash" unless data.is_a?(Hash) @kind = kind @data = EventSanitizer.data(data) freeze end |
Instance Attribute Details
#data ⇒ Object (readonly)
: Hash[String, EventSanitizer::json_value]
147 148 149 |
# File 'lib/ibex/runtime/syntax_session.rb', line 147 def data @data end |
#kind ⇒ Object (readonly)
: Symbol
146 147 148 |
# File 'lib/ibex/runtime/syntax_session.rb', line 146 def kind @kind end |
Instance Method Details
#to_h ⇒ Object
160 161 162 |
# File 'lib/ibex/runtime/syntax_session.rb', line 160 def to_h @data end |