Class: SyntaxTree::LParen
Overview
LParen represents the use of a left parenthesis, i.e., (.
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
- Array[ Comment | EmbDoc ]
-
the comments attached to this node.
-
#value ⇒ Object
readonly
- String
-
the left parenthesis.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
- #format(q) ⇒ Object
-
#initialize(value:, location:, comments: []) ⇒ LParen
constructor
A new instance of LParen.
Methods inherited from Node
Constructor Details
#initialize(value:, location:, comments: []) ⇒ LParen
Returns a new instance of LParen.
5418 5419 5420 5421 5422 |
# File 'lib/syntax_tree/node.rb', line 5418 def initialize(value:, location:, comments: []) @value = value @location = location @comments = comments end |
Instance Attribute Details
#comments ⇒ Object (readonly)
- Array[ Comment | EmbDoc ]
-
the comments attached to this node
5416 5417 5418 |
# File 'lib/syntax_tree/node.rb', line 5416 def comments @comments end |
#value ⇒ Object (readonly)
- String
-
the left parenthesis
5413 5414 5415 |
# File 'lib/syntax_tree/node.rb', line 5413 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
5424 5425 5426 |
# File 'lib/syntax_tree/node.rb', line 5424 def accept(visitor) visitor.visit_lparen(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
5428 5429 5430 |
# File 'lib/syntax_tree/node.rb', line 5428 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
5434 5435 5436 |
# File 'lib/syntax_tree/node.rb', line 5434 def deconstruct_keys(keys) { value: value, location: location, comments: comments } end |
#format(q) ⇒ Object
5438 5439 5440 |
# File 'lib/syntax_tree/node.rb', line 5438 def format(q) q.text(value) end |