Sha256: aab304d90fd402cd7849ce3a6e74b8c7f7625220bfdc47b9850f0358cb99ef1e
Contents?: true
Size: 575 Bytes
Versions: 35
Compression:
Stored size: 575 Bytes
Contents
# frozen_string_literal: true 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
35 entries across 35 versions & 1 rubygems