Module: RubyOptimize::CommonControllersAndHelpers

Included in:
ActionControllerExtension, ActionViewExtension
Defined in:
lib/ruby_optimize/common_controllers_and_helpers.rb

Instance Method Summary collapse

Instance Method Details

#ruby_optimize(versions, **params) ⇒ Object



3
4
5
6
7
8
# File 'lib/ruby_optimize/common_controllers_and_helpers.rb', line 3

def ruby_optimize(versions, **params)
  @ruby_optimize = {} if @ruby_optimize.nil?
  scope = params[:scope] || :default
  raise "RubyOptimize - scope already defined: #{scope.inspect}" if @ruby_optimize.has_key?(scope)
  @ruby_optimize[scope] = AbTestHandler.new(cookies, versions, scope, request.user_agent, params[:domain], params[:cookie_expiration], params[:version_for_crawler], !!params[:session_cookie], params[:weights])
end