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
8971 8972 8973 8974 |
# File 'lib/syntax_tree/node.rb', line 8971 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the beginning of the lambda literal
8969 8970 8971 |
# File 'lib/syntax_tree/node.rb', line 8969 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8976 8977 8978 |
# File 'lib/syntax_tree/node.rb', line 8976 def accept(visitor) visitor.visit_tlambda(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8980 8981 8982 |
# File 'lib/syntax_tree/node.rb', line 8980 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
8986 8987 8988 |
# File 'lib/syntax_tree/node.rb', line 8986 def deconstruct_keys(_keys) { value: value, location: location } end |