Class: Verdict::Group
Direct Known Subclasses
Segmenters::FixedPercentageSegmenter::Group, Segmenters::RolloutSegmenter::Group, Segmenters::StaticSegmenter::Group
Instance Attribute Summary collapse
-
#experiment ⇒ Object
readonly
Returns the value of attribute experiment.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
Instance Method Summary collapse
- #===(other) ⇒ Object
- #as_json(options = {}) ⇒ Object
-
#initialize(experiment, handle) ⇒ Group
constructor
A new instance of Group.
- #to_json(options = {}) ⇒ Object
- #to_s ⇒ Object
- #to_sym ⇒ Object
Methods included from Metadata
#description, included, #name, #owner, #screenshot
Constructor Details
#initialize(experiment, handle) ⇒ Group
Returns a new instance of Group.
6 7 8 |
# File 'lib/verdict/group.rb', line 6 def initialize(experiment, handle) @experiment, @handle = experiment, handle.to_s end |
Instance Attribute Details
#experiment ⇒ Object (readonly)
Returns the value of attribute experiment.
4 5 6 |
# File 'lib/verdict/group.rb', line 4 def experiment @experiment end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
4 5 6 |
# File 'lib/verdict/group.rb', line 4 def handle @handle end |
Instance Method Details
#===(other) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/verdict/group.rb', line 18 def ===(other) case other when Verdict::Group; experiment == other.experiment && other.handle == handle when Symbol, String; handle == other.to_s else false end end |
#as_json(options = {}) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/verdict/group.rb', line 26 def as_json( = {}) { handle: handle, metadata: } end |
#to_json(options = {}) ⇒ Object
33 34 35 |
# File 'lib/verdict/group.rb', line 33 def to_json( = {}) as_json().to_json end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/verdict/group.rb', line 10 def to_s handle end |
#to_sym ⇒ Object
14 15 16 |
# File 'lib/verdict/group.rb', line 14 def to_sym handle.to_sym end |