Class: SyntaxTree::StringContent

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/node.rb

Overview

StringContent represents the contents of a string-like value.

"string"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json

Constructor Details

#initialize(parts:, location:) ⇒ StringContent

Returns a new instance of StringContent.



9536
9537
9538
9539
# File 'lib/syntax_tree/node.rb', line 9536

def initialize(parts:, location:)
  @parts = parts
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



9534
9535
9536
# File 'lib/syntax_tree/node.rb', line 9534

def location
  @location
end

#partsObject (readonly)

Array[ StringEmbExpr | StringDVar | TStringContent ]

the parts of the

string



9531
9532
9533
# File 'lib/syntax_tree/node.rb', line 9531

def parts
  @parts
end