Class: SyntaxTree::TLambda

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/node.rb

Overview

TLambda represents the beginning of a lambda literal.

-> { value }

In the example above the TLambda represents the -> operator.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json

Constructor Details

#initialize(value:, location:) ⇒ TLambda

Returns a new instance of TLambda.



10114
10115
10116
10117
# File 'lib/syntax_tree/node.rb', line 10114

def initialize(value:, location:)
  @value = value
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



10112
10113
10114
# File 'lib/syntax_tree/node.rb', line 10112

def location
  @location
end

#valueObject (readonly)

String

the beginning of the lambda literal



10109
10110
10111
# File 'lib/syntax_tree/node.rb', line 10109

def value
  @value
end