Class: Planout::RandomInteger

Inherits:
OpRandom show all
Defined in:
lib/planout/random_integer.rb

Constant Summary

Constants inherited from OpRandom

OpRandom::LongScale

Instance Attribute Summary

Attributes inherited from Operator

#args

Instance Method Summary collapse

Methods inherited from OpRandom

#get_hash, #get_uniform, #get_unit

Methods inherited from OpSimple

#execute

Methods inherited from Operator

#execute, #initialize

Constructor Details

This class inherits a constructor from Planout::Operator

Instance Method Details

#simple_executeObject



5
6
7
8
9
# File 'lib/planout/random_integer.rb', line 5

def simple_execute
  min_val = @parameters.fetch(:min, 0)
  max_val = @parameters.fetch(:max, 1)
  min_val + get_hash() % (max_val - min_val + 1)
end