module Abtest
Constants
- VERSION
Public Class Methods
abtest_config()
click to toggle source
# File lib/abtest/registry.rb, line 13 def self.abtest_config Rails.application.config.abtest end
register_test(name, test, process = nil)
click to toggle source
Register a test. This method takes the following parameters: name: Name of the experiment. test: A lambda used to determine whether or not to activate this test. The provided
lambda must return a truthy value for the test to be activated and accept a request object.
process (optional): Lambda to run in the case of a test being activated. Will be passed the controller object.
# File lib/abtest/registry.rb, line 9 def self.register_test(name, test, process = nil) abtest_config.registered_tests.add({name: name, check: test, process: process}) end