Module: Abtest
- Defined in:
- lib/abtest.rb,
lib/abtest/filters.rb,
lib/abtest/railtie.rb,
lib/abtest/version.rb,
lib/abtest/registry.rb,
lib/abtest/asset_task.rb
Defined Under Namespace
Modules: Filters Classes: AssetTask, ManifestManager, Railtie
Constant Summary collapse
- VERSION =
"2.0.0"
Class Method Summary collapse
Class Method Details
.abtest_config ⇒ Object
13 14 15 |
# File 'lib/abtest/registry.rb', line 13 def self.abtest_config Rails.application.config.abtest end |
.register_test(name, test, process = nil) ⇒ Object
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.
9 10 11 |
# 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 |