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

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

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

Returns:

  • (Boolean)


21
22
23
# File 'lib/kameleoon/types/variation.rb', line 21

def active?
  variation_key != Configuration::VariationType::VARIATION_OFF
end

#to_sObject



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