Class: Caboose::AbVariant

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/caboose/ab_variant.rb

Overview

Class for A-B testing variants. A variant is a set of changes to the same element on a page. For example, a variant can be used to change the button text, or images displayed, or even more complicated behavior

Instance Method Summary collapse

Instance Method Details

#random_optionObject


12
13
14
15
# File 'app/models/caboose/ab_variant.rb', line 12

def random_option
  return nil if self.ab_options.nil? || self.ab_options.count == 0
  return self.ab_options.sample    
end