Sha256: 82bef3c0de1603c7dc29e2b1eca87fb4fb126582a132847d07d2749c8d002886
Contents?: true
Size: 1.12 KB
Versions: 5
Compression:
Stored size: 1.12 KB
Contents
module Hanami module Components module App # hanami-view configuration for a sigle Hanami application in the project. # # @since 0.9.0 # @api private class View # Configure hanami-view for a single Hanami application in the project. # # @param app [Hanami::Configuration::App] a Hanami application # # @since 0.9.0 # @api private # # rubocop:disable Metrics/AbcSize # rubocop:disable Metrics/MethodLength def self.resolve(app) config = app.configuration namespace = app.namespace unless namespace.const_defined?('View', false) view = Hanami::View.duplicate(namespace) do root config.templates layout config.layout config.view.__apply(self) end namespace.const_set('View', view) end Components.resolved "#{app.app_name}.view", namespace.const_get('View').configuration end end # rubocop:enable Metrics/MethodLength # rubocop:enable Metrics/AbcSize end end end
Version data entries
5 entries across 5 versions & 1 rubygems