Class: Foxtail::Syntax::Parser::AST::SelectExpression

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

Overview

Represents select expressions for conditional message variants

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(selector, variants) ⇒ SelectExpression

Returns a new instance of SelectExpression.



12
13
14
15
16
# File 'lib/foxtail/syntax/parser/ast/select_expression.rb', line 12

def initialize(selector, variants)
  super()
  @selector = selector
  @variants = variants
end

Instance Attribute Details

#selectorObject

Returns the value of attribute selector.



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

def selector
  @selector
end

#variantsObject

Returns the value of attribute variants.



10
11
12
# File 'lib/foxtail/syntax/parser/ast/select_expression.rb', line 10

def variants
  @variants
end

Instance Method Details

#childrenObject



18
# File 'lib/foxtail/syntax/parser/ast/select_expression.rb', line 18

def children = [selector, *variants]