Class: Hanami::View::Rendering::Registry Private
- Inherits:
-
LayoutRegistry
- Object
- LayoutRegistry
- Hanami::View::Rendering::Registry
- Defined in:
- lib/hanami/view/rendering/registry.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Holds all the references of all the registered subclasses of a view. We have one registry for each superclass view.
Constant Summary collapse
- DEFAULT_FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Default format for views without an explicit format.
:all
Instance Method Summary collapse
-
#resolve(context) ⇒ Hanami::View
private
Returns the view for the given context.
Methods inherited from LayoutRegistry
Constructor Details
This class inherits a constructor from Hanami::View::Rendering::LayoutRegistry
Instance Method Details
#resolve(context) ⇒ Hanami::View
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the view for the given context.
91 92 93 94 |
# File 'lib/hanami/view/rendering/registry.rb', line 91 def resolve(context) view, template = @registry.fetch(format(context)) { @registry[DEFAULT_FORMAT] } view.new(template, context) end |