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.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(key, id, experiment_id, variables, name = '') ⇒ Variation
constructor
private
A new instance of Variation.
- #to_s ⇒ Object
Constructor Details
#initialize(key, id, experiment_id, variables, name = '') ⇒ Variation
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Variation.
16 17 18 19 20 21 22 |
# File 'lib/kameleoon/types/variation.rb', line 16 def initialize(key, id, experiment_id, variables, name = '') @key = key @id = id @experiment_id = experiment_id @variables = variables @name = name end |
Instance Attribute Details
#experiment_id ⇒ Object (readonly)
Returns the value of attribute experiment_id.
9 10 11 |
# File 'lib/kameleoon/types/variation.rb', line 9 def experiment_id @experiment_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/kameleoon/types/variation.rb', line 9 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/kameleoon/types/variation.rb', line 9 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/kameleoon/types/variation.rb', line 9 def name @name end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
9 10 11 |
# File 'lib/kameleoon/types/variation.rb', line 9 def variables @variables end |
Instance Method Details
#active? ⇒ Boolean
24 25 26 |
# File 'lib/kameleoon/types/variation.rb', line 24 def active? @key != Configuration::VariationType::VARIATION_OFF end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/kameleoon/types/variation.rb', line 11 def to_s "Variation{name:'#{@name}',key:'#{@key}',id:#{@id},experiment_id:#{@experiment_id},variables:#{@variables}}" end |