Class: SyntaxTree::TLamBeg

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

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

Attributes inherited from Node

#location

Instance Method Summary collapse

Methods inherited from Node

#construct_keys, #format, #pretty_print, #to_json

Constructor Details

#initialize(value:, location:) ⇒ TLamBeg

Returns a new instance of TLamBeg.



8784
8785
8786
8787
# File 'lib/syntax_tree/node.rb', line 8784

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

Instance Attribute Details

#valueObject (readonly)

String

the beginning of the body of the lambda literal



8782
8783
8784
# File 'lib/syntax_tree/node.rb', line 8782

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



8789
8790
8791
# File 'lib/syntax_tree/node.rb', line 8789

def accept(visitor)
  visitor.visit_tlambeg(self)
end

#child_nodesObject Also known as: deconstruct



8793
8794
8795
# File 'lib/syntax_tree/node.rb', line 8793

def child_nodes
  []
end

#deconstruct_keys(_keys) ⇒ Object



8799
8800
8801
# File 'lib/syntax_tree/node.rb', line 8799

def deconstruct_keys(_keys)
  { value: value, location: location }
end