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