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.



7324
7325
7326
7327
# File 'lib/syntax_tree/node.rb', line 7324

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

Instance Attribute Details

#valueObject (readonly)

String

the right brace



7322
7323
7324
# File 'lib/syntax_tree/node.rb', line 7322

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



7329
7330
7331
# File 'lib/syntax_tree/node.rb', line 7329

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

#child_nodesObject Also known as: deconstruct



7333
7334
7335
# File 'lib/syntax_tree/node.rb', line 7333

def child_nodes
  []
end

#deconstruct_keys(_keys) ⇒ Object



7339
7340
7341
# File 'lib/syntax_tree/node.rb', line 7339

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