Class: JSON5::StringNode
Instance Attribute Summary collapse
-
#code_units ⇒ Object
readonly
Returns the value of attribute code_units.
-
#escape_spans ⇒ Object
readonly
Returns the value of attribute escape_spans.
-
#quote ⇒ Object
readonly
Returns the value of attribute quote.
Attributes inherited from Node
#end_byte, #leading_trivia, #raw_span, #source, #start_byte, #trailing_trivia, #type
Instance Method Summary collapse
-
#initialize(code_units:, quote:, escape_spans: [], **attributes) ⇒ StringNode
constructor
A new instance of StringNode.
Methods inherited from Node
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_units ⇒ Object (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_spans ⇒ Object (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 |
#quote ⇒ Object (readonly)
Returns the value of attribute quote.
26 27 28 |
# File 'lib/json5/document_nodes.rb', line 26 def quote @quote end |