Sha256: 80c905963c525527c6a8aed12ef682c954f258afaeb0747c4796d1a70d93af3f
Contents?: true
Size: 948 Bytes
Versions: 6
Compression:
Stored size: 948 Bytes
Contents
require 'erb' module Voom module Presenters module WebClient # This class renders headers for the plugins into the default layout. class PluginHeaders extend Pluggable include_plugins(:WebClientComponents) def initialize(pom:, render:) @pom = pom @render = render initialize_plugins end def render results = "" ((@plugins||[]) + Voom::Presenters::Settings.config.presenters.plugins).each do |plugin| header_method = :"render_header_#{plugin}" results << send(header_method, @pom, render: @render) if respond_to?(header_method) end results end private def initialize_plugins @plugins = @pom.send(:plugins) self.class.include_plugins(:WebClientComponents, plugins: @plugins) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems