Class: SyntaxTree::TLamBeg
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
-
#value ⇒ Object
readonly
- String
-
the beginning of the body of the lambda literal.
Attributes inherited from Node
Instance Method Summary collapse
- #===(other) ⇒ Object
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #copy(value: nil, location: nil) ⇒ Object
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(value:, location:) ⇒ TLamBeg
constructor
A new instance of TLamBeg.
Methods inherited from Node
#construct_keys, #end_char, #format, #pretty_print, #start_char, #to_json, #to_mermaid
Constructor Details
#initialize(value:, location:) ⇒ TLamBeg
Returns a new instance of TLamBeg.
10769 10770 10771 10772 |
# File 'lib/syntax_tree/node.rb', line 10769 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the beginning of the body of the lambda literal
10767 10768 10769 |
# File 'lib/syntax_tree/node.rb', line 10767 def value @value end |
Instance Method Details
#===(other) ⇒ Object
10795 10796 10797 |
# File 'lib/syntax_tree/node.rb', line 10795 def ===(other) other.is_a?(TLamBeg) && value === other.value end |
#accept(visitor) ⇒ Object
10774 10775 10776 |
# File 'lib/syntax_tree/node.rb', line 10774 def accept(visitor) visitor.visit_tlambeg(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
10778 10779 10780 |
# File 'lib/syntax_tree/node.rb', line 10778 def child_nodes [] end |
#copy(value: nil, location: nil) ⇒ Object
10782 10783 10784 10785 10786 10787 |
# File 'lib/syntax_tree/node.rb', line 10782 def copy(value: nil, location: nil) TLamBeg.new( value: value || self.value, location: location || self.location ) end |
#deconstruct_keys(_keys) ⇒ Object
10791 10792 10793 |
# File 'lib/syntax_tree/node.rb', line 10791 def deconstruct_keys(_keys) { value: value, location: location } end |