Sha256: b254c62af61c3ac2fddaeee47f65e7868d6778d502575043697cb2f7e25930df

Contents?: true

Size: 1.09 KB

Versions: 12

Compression:

Stored size: 1.09 KB

Contents

module Coprl
  module Presenters
    module Plugins
      module <%= classify(name) %>
        module WebClientComponents
          def view_dir_<%= underscore(name) %>(pom)
            File.join(__dir__, '../../../../../../..', 'views', 'components')
          end

          def render_<%= underscore(name) %>(comp,render:, components:, index:)
            render.call :erb, :<%= underscore(name) %>, views: view_dir_<%= underscore(name) %>(comp),
                        locals: {comp: comp,
                        components: components, index: index}
          end

          # The string returned from this method will be added to the HTML header section of the page layout
          # It will be called once for the page.
          # The pom is passed along with the sinatra render method.
          def render_header_<%= underscore(name) %>(pom, render:)
            view_dir = File.join(__dir__, '../../../../../../..', 'views', 'components')
            render.call :erb, :<%= underscore(name) %>_header, views: view_dir_<%= underscore(name) %>(pom)
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.11 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.10 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.9 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.8 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.7 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.6 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.5 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.4 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.3 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.2 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt
coprl-3.0.0.beta.1 lib/coprl/presenters/generators/templates/plugin/lib/coprl/presenters/plugins/web_client/components/render.rb.tt