Class: JSON5::StringNode

Inherits:
Node
  • Object
show all
Defined in:
lib/json5/document_nodes.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#end_byte, #leading_trivia, #raw_span, #source, #start_byte, #trailing_trivia, #type

Instance Method Summary collapse

Methods inherited from Node

#raw

Constructor Details

#initialize(code_units:, quote:, escape_spans: [], **attributes) ⇒ StringNode

Returns a new instance of StringNode.



28
29
30
31
32
33
# File 'lib/json5/document_nodes.rb', line 28

def initialize(code_units:, quote:, escape_spans: [], **attributes)
  @code_units = code_units
  @quote = quote
  @escape_spans = escape_spans.dup.freeze
  super(type: :string, **attributes)
end

Instance Attribute Details

#code_unitsObject (readonly)

Returns the value of attribute code_units.



26
27
28
# File 'lib/json5/document_nodes.rb', line 26

def code_units
  @code_units
end

#escape_spansObject (readonly)

Returns the value of attribute escape_spans.



26
27
28
# File 'lib/json5/document_nodes.rb', line 26

def escape_spans
  @escape_spans
end

#quoteObject (readonly)

Returns the value of attribute quote.



26
27
28
# File 'lib/json5/document_nodes.rb', line 26

def quote
  @quote
end