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
#format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ TLambda
Returns a new instance of TLambda.
7927 7928 7929 7930 |
# File 'lib/syntax_tree/node.rb', line 7927 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the beginning of the lambda literal
7925 7926 7927 |
# File 'lib/syntax_tree/node.rb', line 7925 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
7932 7933 7934 |
# File 'lib/syntax_tree/node.rb', line 7932 def accept(visitor) visitor.visit_tlambda(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
7936 7937 7938 |
# File 'lib/syntax_tree/node.rb', line 7936 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
7942 7943 7944 |
# File 'lib/syntax_tree/node.rb', line 7942 def deconstruct_keys(keys) { value: value, location: location } end |