Class: SyntaxTree::RBrace
- Inherits:
-
Node
- Object
- Node
- SyntaxTree::RBrace
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
8836
8837
8838
8839
|
# File 'lib/syntax_tree/node.rb', line 8836
def initialize(value:, location:)
@value = value
@location = location
end
|
Instance Attribute Details
#value ⇒ Object
8834
8835
8836
|
# File 'lib/syntax_tree/node.rb', line 8834
def value
@value
end
|
Instance Method Details
#===(other) ⇒ Object
8862
8863
8864
|
# File 'lib/syntax_tree/node.rb', line 8862
def ===(other)
other.is_a?(RBrace) && value === other.value
end
|
#accept(visitor) ⇒ Object
8841
8842
8843
|
# File 'lib/syntax_tree/node.rb', line 8841
def accept(visitor)
visitor.visit_rbrace(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
8845
8846
8847
|
# File 'lib/syntax_tree/node.rb', line 8845
def child_nodes
[]
end
|
#copy(value: nil, location: nil) ⇒ Object
8849
8850
8851
8852
8853
8854
|
# File 'lib/syntax_tree/node.rb', line 8849
def copy(value: nil, location: nil)
RBrace.new(
value: value || self.value,
location: location || self.location
)
end
|
#deconstruct_keys(_keys) ⇒ Object
8858
8859
8860
|
# File 'lib/syntax_tree/node.rb', line 8858
def deconstruct_keys(_keys)
{ value: value, location: location }
end
|