Class: ABSplit::Functions::WeightedSplit
- Inherits:
-
Object
- Object
- ABSplit::Functions::WeightedSplit
- Defined in:
- lib/a_b_split/functions/weighted_split.rb
Overview
Weighted split based on hash value.
Non persistent - No collisions are possible
Based on memory position
Direct Known Subclasses
Constant Summary collapse
- MAX_POSITIONS =
capacity of Fixnum
(9_999_999_999_999_999_999 * 2) + 1
Class Method Summary collapse
Class Method Details
.value_for(value, *params) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/a_b_split/functions/weighted_split.rb', line 14 def value_for(value, *params) given_weights = validate(params) experiments = split_weights(params, params.size, given_weights) select_experiment_for(value, experiments) end |