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.



7271
7272
7273
7274
# File 'lib/syntax_tree/node.rb', line 7271

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

Instance Attribute Details

#value ⇒ Object (readonly)

[String] the right brace



7269
7270
7271
# File 'lib/syntax_tree/node.rb', line 7269

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



7276
7277
7278
# File 'lib/syntax_tree/node.rb', line 7276

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

#child_nodes ⇒ Object Also known as: deconstruct



7280
7281
7282
# File 'lib/syntax_tree/node.rb', line 7280

def child_nodes
  []
end

#deconstruct_keys(_keys) ⇒ Object



7286
7287
7288
# File 'lib/syntax_tree/node.rb', line 7286

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