Sha256: e7ffc270e004e52c8eeeb1ff9d82a5346074930b4bc31b89dc611c2a52191919
Contents?: true
Size: 620 Bytes
Versions: 32
Compression:
Stored size: 620 Bytes
Contents
# frozen_string_literal: true require 'spotlight/page_content/sir_trevor' module Spotlight # Factory for picking the right page content renderer module PageContent def self.for(page, attribute) content_type = page.content_type content_class = Spotlight::PageContent.const_get(content_type) if Spotlight::PageContent.const_defined?(content_type) content_class ||= default_page_content_class content_class.parse(page, attribute) end def self.default_page_content_class Spotlight::PageContent.const_get(Spotlight::Engine.config.default_page_content_type) end end end
Version data entries
32 entries across 32 versions & 1 rubygems