if @testing_xxx # test pattern else # not test pattern end : end def detect_testing_xxx test = TestingXXX.new(params, request, cookies) return false unless test.available_env? return false unless test.available_device? if test.test_mode_enable? cookies[TestingXXX::COOKIE_NAME] = { value: params[:test_mode], expires: 1.year.from_now } end test.new_design_mode? end def detect_testing_xxx test = TestingFairs.new(params, request, cookies) @testing_xxx = detect_testing_xxx end end