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

#construct_keys, #format, #pretty_print, #to_json

Constructor Details

#initialize(value:, location:) ⇒ RBrace

Returns a new instance of RBrace.



7534
7535
7536
7537
# File 'lib/syntax_tree/node.rb', line 7534

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

Instance Attribute Details

#valueObject (readonly)

String

the right brace



7532
7533
7534
# File 'lib/syntax_tree/node.rb', line 7532

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



7539
7540
7541
# File 'lib/syntax_tree/node.rb', line 7539

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

#child_nodesObject Also known as: deconstruct



7543
7544
7545
# File 'lib/syntax_tree/node.rb', line 7543

def child_nodes
  []
end

#deconstruct_keys(_keys) ⇒ Object



7549
7550
7551
# File 'lib/syntax_tree/node.rb', line 7549

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