Class: Foxtail::Syntax::Parser::AST::Variant
- Inherits:
-
SyntaxNode
- Object
- BaseNode
- SyntaxNode
- Foxtail::Syntax::Parser::AST::Variant
- Defined in:
- lib/foxtail/syntax/parser/ast/variant.rb
Overview
Represents individual variants within select expressions
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from SyntaxNode
Attributes inherited from BaseNode
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(key, value, default: false) ⇒ Variant
constructor
A new instance of Variant.
Methods inherited from SyntaxNode
Methods inherited from BaseNode
Constructor Details
#initialize(key, value, default: false) ⇒ Variant
Returns a new instance of Variant.
13 14 15 16 17 18 |
# File 'lib/foxtail/syntax/parser/ast/variant.rb', line 13 def initialize(key, value, default: false) super() @key = key @value = value @default = default end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
11 12 13 |
# File 'lib/foxtail/syntax/parser/ast/variant.rb', line 11 def default @default end |
#key ⇒ Object
Returns the value of attribute key.
9 10 11 |
# File 'lib/foxtail/syntax/parser/ast/variant.rb', line 9 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/foxtail/syntax/parser/ast/variant.rb', line 10 def value @value end |
Instance Method Details
#children ⇒ Object
20 |
# File 'lib/foxtail/syntax/parser/ast/variant.rb', line 20 def children = [key, value] |