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.
5941 5942 5943 5944 5945 |
# File 'lib/syntax_tree/node.rb', line 5941 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
5939 5940 5941 |
# File 'lib/syntax_tree/node.rb', line 5939 def comments @comments end |
#value ⇒ Object (readonly)
- String
-
the left parenthesis
5936 5937 5938 |
# File 'lib/syntax_tree/node.rb', line 5936 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
5947 5948 5949 |
# File 'lib/syntax_tree/node.rb', line 5947 def accept(visitor) visitor.visit_lparen(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
5951 5952 5953 |
# File 'lib/syntax_tree/node.rb', line 5951 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
5957 5958 5959 |
# File 'lib/syntax_tree/node.rb', line 5957 def deconstruct_keys(keys) { value: value, location: location, comments: comments } end |
#format(q) ⇒ Object
5961 5962 5963 |
# File 'lib/syntax_tree/node.rb', line 5961 def format(q) q.text(value) end |