Class: Kameleoon::Types::Variation

Inherits:
Object
  • Object
show all
Defined in:
lib/kameleoon/types/variation.rb

Overview

Variation

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'lib/kameleoon/types/variation.rb', line 9

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



9
10
11
# File 'lib/kameleoon/types/variation.rb', line 9

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/kameleoon/types/variation.rb', line 9

def name
  @name
end

#variablesObject (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

Returns:

  • (Boolean)


24
25
26
# File 'lib/kameleoon/types/variation.rb', line 24

def active?
  @key != Configuration::VariationType::VARIATION_OFF
end

#to_sObject



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