Class: Verdict::Segmenters::RolloutSegmenter::Group
- Defined in:
- lib/verdict/segmenters/rollout_segmenter.rb
Instance Attribute Summary collapse
-
#percentile_range ⇒ Object
readonly
Returns the value of attribute percentile_range.
Attributes inherited from Group
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(experiment, handle, percentile_range) ⇒ Group
constructor
A new instance of Group.
- #percentage_size ⇒ Object
- #to_s ⇒ Object
Methods inherited from Group
Methods included from Metadata
#description, included, #name, #owner, #screenshot
Constructor Details
#initialize(experiment, handle, percentile_range) ⇒ Group
Returns a new instance of Group.
36 37 38 39 |
# File 'lib/verdict/segmenters/rollout_segmenter.rb', line 36 def initialize(experiment, handle, percentile_range) super(experiment, handle) @percentile_range = percentile_range end |
Instance Attribute Details
#percentile_range ⇒ Object (readonly)
Returns the value of attribute percentile_range.
34 35 36 |
# File 'lib/verdict/segmenters/rollout_segmenter.rb', line 34 def percentile_range @percentile_range end |
Instance Method Details
#as_json(options = {}) ⇒ Object
49 50 51 |
# File 'lib/verdict/segmenters/rollout_segmenter.rb', line 49 def as_json( = {}) super().merge(percentage: percentage_size) end |
#percentage_size ⇒ Object
41 42 43 |
# File 'lib/verdict/segmenters/rollout_segmenter.rb', line 41 def percentage_size percentile_range.end - percentile_range.begin end |
#to_s ⇒ Object
45 46 47 |
# File 'lib/verdict/segmenters/rollout_segmenter.rb', line 45 def to_s "#{handle} (#{percentage_size}%)" end |