Class: SyntaxTree::TLamBeg
Overview
TLamBeg represents the beginning of the body of a lambda literal using braces.
-> { value }
In the example above the TLamBeg represents the { operator.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the beginning of the body of the lambda literal.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value:, location:) ⇒ TLamBeg
constructor
A new instance of TLamBeg.
Methods inherited from Node
#format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ TLamBeg
Returns a new instance of TLamBeg.
8501 8502 8503 8504 |
# File 'lib/syntax_tree/node.rb', line 8501 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the beginning of the body of the lambda literal
8499 8500 8501 |
# File 'lib/syntax_tree/node.rb', line 8499 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8506 8507 8508 |
# File 'lib/syntax_tree/node.rb', line 8506 def accept(visitor) visitor.visit_tlambeg(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8510 8511 8512 |
# File 'lib/syntax_tree/node.rb', line 8510 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
8516 8517 8518 |
# File 'lib/syntax_tree/node.rb', line 8516 def deconstruct_keys(keys) { value: value, location: location } end |