Class: Synthra::Parser::AST::ProbabilityDirective

Inherits:
DirectiveNode show all
Defined in:
lib/synthra/parser/ast.rb

Overview

Probability directive

Sets the probability of this scenario being selected.

Examples:

DSL

@probability 80%

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(percentage:, line: nil) ⇒ ProbabilityDirective

Create a new ProbabilityDirective

Parameters:

  • percentage (Integer)

    probability percentage

  • line (Integer, nil) (defaults to: nil)

    source line number



1177
1178
1179
1180
# File 'lib/synthra/parser/ast.rb', line 1177

def initialize(percentage:, line: nil)
  super(line: line)
  @percentage = percentage
end

Instance Attribute Details

#percentageObject (readonly)

Returns the value of attribute percentage.



1169
1170
1171
# File 'lib/synthra/parser/ast.rb', line 1169

def percentage
  @percentage
end