Class: Ibex::Runtime::SyntaxSessionDiagnostic
- Inherits:
-
Object
- Object
- Ibex::Runtime::SyntaxSessionDiagnostic
- Defined in:
- lib/json5/generated_parser.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
- #kind ⇒ Object readonly
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.
4074 4075 4076 4077 4078 4079 4080 4081 |
# File 'lib/json5/generated_parser.rb', line 4074 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)
4071 4072 4073 |
# File 'lib/json5/generated_parser.rb', line 4071 def data @data end |
#kind ⇒ Object (readonly)
4070 4071 4072 |
# File 'lib/json5/generated_parser.rb', line 4070 def kind @kind end |
Instance Method Details
#to_h ⇒ Object
4084 4085 4086 |
# File 'lib/json5/generated_parser.rb', line 4084 def to_h @data end |