Class: Voom::Presenters::WebClient::PluginHeaders
- Inherits:
-
Object
- Object
- Voom::Presenters::WebClient::PluginHeaders
- Extended by:
- Pluggable
- Defined in:
- lib/voom/presenters/web_client/plugin_headers.rb
Overview
This class renders headers for the plugins into the default layout.
Instance Method Summary collapse
-
#initialize(pom:, render:) ⇒ PluginHeaders
constructor
A new instance of PluginHeaders.
- #render ⇒ Object
Methods included from Pluggable
include_plugins, plugin, plugin_module
Constructor Details
#initialize(pom:, render:) ⇒ PluginHeaders
Returns a new instance of PluginHeaders.
11 12 13 14 15 |
# File 'lib/voom/presenters/web_client/plugin_headers.rb', line 11 def initialize(pom:, render:) @pom = pom @render = render initialize_plugins end |
Instance Method Details
#render ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/voom/presenters/web_client/plugin_headers.rb', line 17 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 |