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.



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

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

Instance Attribute Details

#value ⇒ Object (readonly)

[String] the right brace



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

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



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

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

#child_nodes ⇒ Object Also known as: deconstruct



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

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



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

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