Module: Split::Cacheable::Helper::ClassMethods
- Defined in:
- lib/split_cacheable/helper.rb
Instance Method Summary collapse
-
#cacheable_ab_test(test_name, options) ⇒ Object
This is how you specify your tests in a sub-class of ActionController::Base ex: cacheable_ab_test :homepage_hero, :only => :our_story, :if => Rails.env.production?.
-
#split_cacheable_ab_tests ⇒ Object
Class level variable.
Instance Method Details
#cacheable_ab_test(test_name, options) ⇒ Object
This is how you specify your tests in a sub-class of ActionController::Base ex: cacheable_ab_test :homepage_hero, :only => :our_story, :if => Rails.env.production?
25 26 27 28 29 30 |
# File 'lib/split_cacheable/helper.rb', line 25 def cacheable_ab_test(test_name, ) [:except] = Array([:except]) [:only] = Array([:only]) self.split_cacheable_ab_tests << .merge({:test_name => test_name}) end |
#split_cacheable_ab_tests ⇒ Object
Class level variable. cacheable_ab_test’s get pushed onto it
33 34 35 |
# File 'lib/split_cacheable/helper.rb', line 33 def split_cacheable_ab_tests @split_cacheable_ab_tests ||= Array.new end |