# frozen_string_literal: true class ApplicationLayoutPreloader include ReadOnlyMixin def self.banner_json_cache @banner_json_cache ||= DistributedCache.new("banner_json") end def initialize(guardian:, theme_id:, theme_target:, login_method:) @guardian = guardian @theme_id = theme_id @theme_target = theme_target @login_method = login_method @preloaded = {} end def store_preloaded(key, json) # I dislike that there is a gsub as opposed to a gsub! # but we can not be mucking with user input, I wonder if there is a way # to inject this safety deeper in the library or even in AM serializer @preloaded[key] = json.gsub("