Class: Foxtail::Syntax::Parser::AST::Placeable

Inherits:
SyntaxNode show all
Defined in:
lib/foxtail/syntax/parser/ast/placeable.rb

Overview

Represents expressions within braces {} in a pattern that are evaluated at runtime

Instance Attribute Summary collapse

Attributes inherited from SyntaxNode

#span

Attributes inherited from BaseNode

#type

Instance Method Summary collapse

Methods inherited from SyntaxNode

#add_span

Methods inherited from BaseNode

#==, #accept, #to_h

Constructor Details

#initialize(expression) ⇒ Placeable

Returns a new instance of Placeable.



11
12
13
14
# File 'lib/foxtail/syntax/parser/ast/placeable.rb', line 11

def initialize(expression)
  super()
  @expression = expression
end

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



9
10
11
# File 'lib/foxtail/syntax/parser/ast/placeable.rb', line 9

def expression
  @expression
end

Instance Method Details

#childrenObject



16
# File 'lib/foxtail/syntax/parser/ast/placeable.rb', line 16

def children = [expression]