Class: Foxtail::Bundle::Parser::AST::SelectExpression

Inherits:
Data
  • Object
show all
Defined in:
lib/foxtail/bundle/parser/ast.rb,
lib/foxtail/bundle/parser/ast.rb

Overview

Select expression for pluralization and variants

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selector:, variants:, star: 0) ⇒ SelectExpression

Returns a new instance of SelectExpression.

Parameters:

  • selector

    The expression to match against

  • variants (Array<Variant>)

    The variant branches

  • star (Integer) (defaults to: 0)

    Index of the default variant (default: 0)



94
# File 'lib/foxtail/bundle/parser/ast.rb', line 94

def initialize(selector:, variants:, star: 0) = super

Instance Attribute Details

#selectorObject (readonly)

The expression to match against



90
91
92
# File 'lib/foxtail/bundle/parser/ast.rb', line 90

def selector
  @selector
end

#starObject (readonly)

Integer

Index of the default variant



90
91
92
# File 'lib/foxtail/bundle/parser/ast.rb', line 90

def star
  @star
end

#variantsObject (readonly)

Array<Variant>

The variant branches



90
91
92
# File 'lib/foxtail/bundle/parser/ast.rb', line 90

def variants
  @variants
end