Class: Synthra::Parser::AST::EnumValueNode
- Defined in:
- lib/synthra/parser/ast.rb
Overview
Enum value with optional probability
Represents a single value within an enum type, optionally with a probability weight.
Instance Attribute Summary collapse
-
#probability ⇒ Object
readonly
Returns the value of attribute probability.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value:, probability: nil, line: nil) ⇒ EnumValueNode
constructor
Create a new EnumValueNode.
Constructor Details
#initialize(value:, probability: nil, line: nil) ⇒ EnumValueNode
Create a new EnumValueNode
603 604 605 606 607 |
# File 'lib/synthra/parser/ast.rb', line 603 def initialize(value:, probability: nil, line: nil) super(line: line) @value = value @probability = probability end |
Instance Attribute Details
#probability ⇒ Object (readonly)
Returns the value of attribute probability.
594 595 596 |
# File 'lib/synthra/parser/ast.rb', line 594 def probability @probability end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
588 589 590 |
# File 'lib/synthra/parser/ast.rb', line 588 def value @value end |