Sha256: 46618fb8ff9cb87f0bc966c61ee9cc9a3a66b33fd98f2f60be677267c5c7597f
Contents?: true
Size: 555 Bytes
Versions: 77
Compression:
Stored size: 555 Bytes
Contents
module Scrivito module RequestHomepage HOMEPAGE_ENV_KEY = "SCRIVITO_HOMEPAGE" class << self def call(env) env[HOMEPAGE_ENV_KEY] ||= fetch_homepage(env) end private def fetch_homepage(env) callback_result = Scrivito::Configuration.choose_homepage_callback.call(env) if callback_result.is_a?(Obj) callback_result else raise "choose_homepage callback did not return an Obj. "\ "Instead saw #{callback_result.class}." end end end end end
Version data entries
77 entries across 77 versions & 1 rubygems