Module: AbingoViewHelper
- Defined in:
- lib/abingo_view_helper.rb
Overview
Gives you easy syntax to use ABingo in your views.
Instance Method Summary collapse
- #ab_test(test_name, alternatives = nil, options = {}, &block) ⇒ Object
- #bingo!(test_name, options = {}) ⇒ Object
Instance Method Details
#ab_test(test_name, alternatives = nil, options = {}, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/abingo_view_helper.rb', line 5 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
38 39 40 |
# File 'lib/abingo_view_helper.rb', line 38 def bingo!(test_name, = {}) Abingo.bingo!(test_name, ) end |