Module: Split::Cacheable::Helper::ClassMethods

Defined in:
lib/split_cacheable/helper.rb

Instance Method Summary collapse

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, options)
    options[:except] = Array(options[:except])
    options[:only] = Array(options[:only])

    self.split_cacheable_ab_tests << options.merge({:test_name => test_name})
end

#split_cacheable_ab_testsObject

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