Class Abingo
In: lib/abingo/rails/controller/dashboard.rb
lib/abingo/controller/dashboard.rb
lib/abingo/version.rb
lib/abingo.rb
Parent: Object

Usage of ABingo, including practical hints, is covered at www.bingocardcreator.com/abingo

Methods

Classes and Modules

Module Abingo::Controller
Module Abingo::ConversionRate
Module Abingo::Rails
Module Abingo::Statistics
Class Abingo::Alternative
Class Abingo::Experiment

Constants

VERSION = "2.0.2"

Attributes

identity  [RW] 

Public Class methods

ABingo stores whether a particular user has participated in a particular experiment yet, and if so whether they converted, in the cache.

It is STRONGLY recommended that you use a MemcacheStore for this. If you‘d like to persist this through a system restart or the like, you can look into memcachedb, which speaks the memcached protocol. From the perspective of Rails it is just another MemcachedStore.

You can overwrite Abingo‘s cache instance, if you would like it to not share your generic Rails cache.

This method identifies a user and ensures they consistently see the same alternative. This means that if you use Abingo.identify on someone at login, they will always see the same alternative for a particular test which is past the login screen. For details and usage notes, see the docs.

Protected Class methods

For programmer convenience, we allow you to specify what the alternatives for an experiment are in a few ways. Thus, we need to actually be able to handle all of them. We fire this parser very infrequently (once per test, typically) so it can be as complicated as we want.

   Integer => a number 1 through N
   Range   => a number within the range
   Array   => an element of the array.
   Hash    => assumes a hash of something to int.  We pick one of the
              somethings, weighted accorded to the ints provided.  e.g.
              {:a => 2, :b => 3} produces :a 40% of the time, :b 60%.

Alternatives are always represented internally as an array.

Public Instance methods

Scores conversions for tests. test_name_or_array supports three types of input:

A conversion name: scores a conversion for any test the user is participating in which

  is listening to the specified conversion.

A test name: scores a conversion for the named test if the user is participating in it.

An array of either of the above: for each element of the array, process as above.

nil: score a conversion for every test the u

A simple convenience method for doing an A/B test. Returns true or false. If you pass it a block, it will bind the choice to the variable given to the block.

Marks that this user is human.

This is the meat of A/Bingo. options accepts

  :multiple_participation (true or false)
  :conversion  name of conversion to listen for  (alias: conversion_name)

Protected Instance methods

Quickly determines what alternative to show a given user. Given a test name and their identity, we hash them together (which, for MD5, provably introduces enough entropy that we don‘t care) otherwise

[Validate]