Class: Kameleoon::Types::Variation
- Inherits:
-
Object
- Object
- Kameleoon::Types::Variation
- Defined in:
- lib/kameleoon/types/variation.rb
Overview
Variation
Instance Attribute Summary collapse
-
#experiment_id ⇒ Object
readonly
Returns the value of attribute experiment_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(key, id, experiment_id, variables) ⇒ Variation
constructor
A new instance of Variation.
- #to_s ⇒ Object
Constructor Details
#initialize(key, id, experiment_id, variables) ⇒ Variation
Returns a new instance of Variation.
14 15 16 17 18 19 |
# File 'lib/kameleoon/types/variation.rb', line 14 def initialize(key, id, experiment_id, variables) @key = key @id = id @experiment_id = experiment_id @variables = variables end |
Instance Attribute Details
#experiment_id ⇒ Object (readonly)
Returns the value of attribute experiment_id.
8 9 10 |
# File 'lib/kameleoon/types/variation.rb', line 8 def experiment_id @experiment_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/kameleoon/types/variation.rb', line 8 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/kameleoon/types/variation.rb', line 8 def key @key end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
8 9 10 |
# File 'lib/kameleoon/types/variation.rb', line 8 def variables @variables end |
Instance Method Details
#active? ⇒ Boolean
21 22 23 |
# File 'lib/kameleoon/types/variation.rb', line 21 def active? variation_key != Configuration::VariationType::VARIATION_OFF end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/kameleoon/types/variation.rb', line 10 def to_s "Variation{key:'#{@key}',id:#{@id},experiment_id:#{@experiment_id},variables:#{@variables}}" end |