Class: SyntaxTree::EmbExprEnd

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

Overview

EmbExprEnd represents the ending token for using interpolation inside of a parent node that accepts string content (like a string or regular expression).

"Hello, #{person}!"

Instance Attribute Summary collapse

Attributes inherited from Node

#location

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print, #to_json

Constructor Details

#initialize(value:, location:) ⇒ EmbExprEnd

Returns a new instance of EmbExprEnd.



3796
3797
3798
3799
# File 'lib/syntax_tree/node.rb', line 3796

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

Instance Attribute Details

#valueObject (readonly)

String

the } used in the string



3794
3795
3796
# File 'lib/syntax_tree/node.rb', line 3794

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



3801
3802
3803
# File 'lib/syntax_tree/node.rb', line 3801

def accept(visitor)
  visitor.visit_embexpr_end(self)
end

#child_nodesObject Also known as: deconstruct



3805
3806
3807
# File 'lib/syntax_tree/node.rb', line 3805

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



3811
3812
3813
# File 'lib/syntax_tree/node.rb', line 3811

def deconstruct_keys(keys)
  { value: value, location: location }
end