Class: AmplitudeExperiment::Variant
- Inherits:
-
Object
- Object
- AmplitudeExperiment::Variant
- Defined in:
- lib/experiment/variant.rb
Overview
Variant
Instance Attribute Summary collapse
-
#payload ⇒ Object?
The attached payload, if any.
-
#value ⇒ String
The value of the variant determined by the flag configuration.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Determine if current variant equal other variant.
-
#initialize(value, payload = nil) ⇒ Variant
constructor
A new instance of Variant.
Constructor Details
#initialize(value, payload = nil) ⇒ Variant
Returns a new instance of Variant.
14 15 16 17 |
# File 'lib/experiment/variant.rb', line 14 def initialize(value, payload = nil) @value = value @payload = payload end |
Instance Attribute Details
#payload ⇒ Object?
The attached payload, if any.
10 11 12 |
# File 'lib/experiment/variant.rb', line 10 def payload @payload end |
#value ⇒ String
The value of the variant determined by the flag configuration.
6 7 8 |
# File 'lib/experiment/variant.rb', line 6 def value @value end |
Instance Method Details
#==(other) ⇒ Object
Determine if current variant equal other variant
21 22 23 24 |
# File 'lib/experiment/variant.rb', line 21 def ==(other) value == other.value && payload == other.payload end |