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
8810
8811
8812
8813
|
# File 'lib/syntax_tree/node.rb', line 8810
def initialize(value:, location:)
@value = value
@location = location
end
|
Instance Attribute Details
#value ⇒ Object
8808
8809
8810
|
# File 'lib/syntax_tree/node.rb', line 8808
def value
@value
end
|
Instance Method Details
#===(other) ⇒ Object
8836
8837
8838
|
# File 'lib/syntax_tree/node.rb', line 8836
def ===(other)
other.is_a?(RBrace) && value === other.value
end
|
#accept(visitor) ⇒ Object
8815
8816
8817
|
# File 'lib/syntax_tree/node.rb', line 8815
def accept(visitor)
visitor.visit_rbrace(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
8819
8820
8821
|
# File 'lib/syntax_tree/node.rb', line 8819
def child_nodes
[]
end
|
#copy(value: nil, location: nil) ⇒ Object
8823
8824
8825
8826
8827
8828
|
# File 'lib/syntax_tree/node.rb', line 8823
def copy(value: nil, location: nil)
RBrace.new(
value: value || self.value,
location: location || self.location
)
end
|
#deconstruct_keys(_keys) ⇒ Object
8832
8833
8834
|
# File 'lib/syntax_tree/node.rb', line 8832
def deconstruct_keys(_keys)
{ value: value, location: location }
end
|