Module: Bandit::ControllerConcerns::InstanceMethods
- Defined in:
- lib/bandit/extensions/controller_concerns.rb
Instance Method Summary collapse
- #bandit_convert!(exp, alt = nil, count = 1) ⇒ Object
- #bandit_final_convert!(exp, alt = nil, count = 1) ⇒ Object
Instance Method Details
#bandit_convert!(exp, alt = nil, count = 1) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/bandit/extensions/controller_concerns.rb', line 12 def bandit_convert!(exp, alt=nil, count=1) = "bandit_#{exp}".intern alt ||= .signed[] unless alt.nil? Bandit.get_experiment(exp).convert!(alt, count) .delete() end end |
#bandit_final_convert!(exp, alt = nil, count = 1) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/bandit/extensions/controller_concerns.rb', line 21 def bandit_final_convert!(exp, alt=nil, count=1) = "bandit_#{exp}".intern = "bandit_#{exp}_converted".intern alt ||= .signed[] unless alt.nil? or .signed[] .permanent.signed[] = "true" Bandit.get_experiment(exp).convert!(alt, count) end end |