Module: AbingoSugar
- Defined in:
- lib/abingo_sugar.rb
Overview
This module exists entirely to save finger strain for programmers. It is designed to be included in your ApplicationController.
See abingo.rb for descriptions of what these do.
Instance Method Summary collapse
- #ab_test(test_name, alternatives = nil, options = {}) ⇒ Object
- #bingo!(test_name, options = {}) ⇒ Object
Instance Method Details
#ab_test(test_name, alternatives = nil, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/abingo_sugar.rb', line 8 def ab_test(test_name, alternatives = nil, = {}) if (Abingo.[:enable_specification] && !params[test_name].blank?) choice = params[test_name] elsif (alternatives.nil?) choice = Abingo.flip(test_name) else choice = Abingo.test(test_name, alternatives, ) end if block_given? yield(choice) else choice end end |
#bingo!(test_name, options = {}) ⇒ Object
24 25 26 |
# File 'lib/abingo_sugar.rb', line 24 def bingo!(test_name, = {}) Abingo.bingo!(test_name, ) end |