Class: Kameleoon::KameleoonClient::EvaluatedExperiment

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(var_by_exp, experiment, rule_type) ⇒ EvaluatedExperiment

Returns a new instance of EvaluatedExperiment.



1309
1310
1311
1312
1313
# File 'lib/kameleoon/kameleoon_client.rb', line 1309

def initialize(var_by_exp, experiment, rule_type)
  @var_by_exp = var_by_exp
  @experiment = experiment
  @rule_type = rule_type
end

Instance Attribute Details

#experimentObject (readonly)

Returns the value of attribute experiment.



1307
1308
1309
# File 'lib/kameleoon/kameleoon_client.rb', line 1307

def experiment
  @experiment
end

#rule_typeObject (readonly)

Returns the value of attribute rule_type.



1307
1308
1309
# File 'lib/kameleoon/kameleoon_client.rb', line 1307

def rule_type
  @rule_type
end

#var_by_expObject (readonly)

Returns the value of attribute var_by_exp.



1307
1308
1309
# File 'lib/kameleoon/kameleoon_client.rb', line 1307

def var_by_exp
  @var_by_exp
end

Class Method Details

.from_forced_experiment_variation(forced_variation) ⇒ Object



1327
1328
1329
# File 'lib/kameleoon/kameleoon_client.rb', line 1327

def self.from_forced_experiment_variation(forced_variation)
  EvaluatedExperiment.from_var_by_exp_rule(forced_variation.var_by_exp, forced_variation.rule)
end

.from_forced_variation(forced_variation) ⇒ Object



1319
1320
1321
1322
1323
1324
1325
# File 'lib/kameleoon/kameleoon_client.rb', line 1319

def self.from_forced_variation(forced_variation)
  if forced_variation.var_by_exp.nil? || forced_variation.rule.nil?
    nil
  else
    EvaluatedExperiment.from_var_by_exp_rule(forced_variation.var_by_exp, forced_variation.rule)
  end
end

.from_var_by_exp_rule(var_by_exp, rule) ⇒ Object



1315
1316
1317
# File 'lib/kameleoon/kameleoon_client.rb', line 1315

def self.from_var_by_exp_rule(var_by_exp, rule)
  EvaluatedExperiment.new(var_by_exp, rule.experiment, rule.type)
end