Class: Mixpanel::Flags::SelectedVariant
- Inherits:
-
Object
- Object
- Mixpanel::Flags::SelectedVariant
- Defined in:
- lib/mixpanel-ruby/flags/types.rb
Overview
Selected variant returned from flag evaluation
Instance Attribute Summary collapse
-
#experiment_id ⇒ Object
Returns the value of attribute experiment_id.
-
#is_experiment_active ⇒ Object
Returns the value of attribute is_experiment_active.
-
#is_qa_tester ⇒ Object
Returns the value of attribute is_qa_tester.
-
#variant_key ⇒ Object
Returns the value of attribute variant_key.
-
#variant_value ⇒ Object
Returns the value of attribute variant_value.
Instance Method Summary collapse
-
#initialize(variant_key: nil, variant_value: nil, experiment_id: nil, is_experiment_active: nil, is_qa_tester: nil) ⇒ SelectedVariant
constructor
A new instance of SelectedVariant.
-
#to_h ⇒ Hash
Convert to hash representation.
Constructor Details
#initialize(variant_key: nil, variant_value: nil, experiment_id: nil, is_experiment_active: nil, is_qa_tester: nil) ⇒ SelectedVariant
Returns a new instance of SelectedVariant.
13 14 15 16 17 18 19 20 |
# File 'lib/mixpanel-ruby/flags/types.rb', line 13 def initialize(variant_key: nil, variant_value: nil, experiment_id: nil, is_experiment_active: nil, is_qa_tester: nil) @variant_key = variant_key @variant_value = variant_value @experiment_id = experiment_id @is_experiment_active = is_experiment_active @is_qa_tester = is_qa_tester end |
Instance Attribute Details
#experiment_id ⇒ Object
Returns the value of attribute experiment_id.
5 6 7 |
# File 'lib/mixpanel-ruby/flags/types.rb', line 5 def experiment_id @experiment_id end |
#is_experiment_active ⇒ Object
Returns the value of attribute is_experiment_active.
5 6 7 |
# File 'lib/mixpanel-ruby/flags/types.rb', line 5 def is_experiment_active @is_experiment_active end |
#is_qa_tester ⇒ Object
Returns the value of attribute is_qa_tester.
5 6 7 |
# File 'lib/mixpanel-ruby/flags/types.rb', line 5 def is_qa_tester @is_qa_tester end |
#variant_key ⇒ Object
Returns the value of attribute variant_key.
5 6 7 |
# File 'lib/mixpanel-ruby/flags/types.rb', line 5 def variant_key @variant_key end |
#variant_value ⇒ Object
Returns the value of attribute variant_value.
5 6 7 |
# File 'lib/mixpanel-ruby/flags/types.rb', line 5 def variant_value @variant_value end |
Instance Method Details
#to_h ⇒ Hash
Convert to hash representation
24 25 26 27 28 29 30 31 32 |
# File 'lib/mixpanel-ruby/flags/types.rb', line 24 def to_h { variant_key: @variant_key, variant_value: @variant_value, experiment_id: @experiment_id, is_experiment_active: @is_experiment_active, is_qa_tester: @is_qa_tester }.compact end |