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

#format, #pretty_print, #to_json

Constructor Details

#initialize(value:, location:) ⇒ TLamBeg

Returns a new instance of TLamBeg.



7957
7958
7959
7960
# File 'lib/syntax_tree/node.rb', line 7957

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

Instance Attribute Details

#valueObject (readonly)

String

the beginning of the body of the lambda literal



7955
7956
7957
# File 'lib/syntax_tree/node.rb', line 7955

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



7962
7963
7964
# File 'lib/syntax_tree/node.rb', line 7962

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

#child_nodesObject Also known as: deconstruct



7966
7967
7968
# File 'lib/syntax_tree/node.rb', line 7966

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



7972
7973
7974
# File 'lib/syntax_tree/node.rb', line 7972

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