Class: SyntaxTree::RBrace

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

Overview

RBrace represents the use of a right brace, i.e., +++.

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:) ⇒ RBrace

Returns a new instance of RBrace.



7068
7069
7070
7071
# File 'lib/syntax_tree/node.rb', line 7068

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

Instance Attribute Details

#valueObject (readonly)

String

the right brace



7066
7067
7068
# File 'lib/syntax_tree/node.rb', line 7066

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



7073
7074
7075
# File 'lib/syntax_tree/node.rb', line 7073

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

#child_nodesObject Also known as: deconstruct



7077
7078
7079
# File 'lib/syntax_tree/node.rb', line 7077

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



7083
7084
7085
# File 'lib/syntax_tree/node.rb', line 7083

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