Class: SyntaxTree::TLambda
Overview
TLambda represents the beginning of a lambda literal.
-> { value }
In the example above the TLambda represents the -> operator.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the beginning 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:) ⇒ TLambda
constructor
A new instance of TLambda.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ TLambda
Returns a new instance of TLambda.
8740 8741 8742 8743 |
# File 'lib/syntax_tree/node.rb', line 8740 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the beginning of the lambda literal
8738 8739 8740 |
# File 'lib/syntax_tree/node.rb', line 8738 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8745 8746 8747 |
# File 'lib/syntax_tree/node.rb', line 8745 def accept(visitor) visitor.visit_tlambda(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8749 8750 8751 |
# File 'lib/syntax_tree/node.rb', line 8749 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
8755 8756 8757 |
# File 'lib/syntax_tree/node.rb', line 8755 def deconstruct_keys(_keys) { value: value, location: location } end |