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