Class: Lotus::View::Rendering::LayoutRegistry Private
- Inherits:
-
Object
- Object
- Lotus::View::Rendering::LayoutRegistry
- Defined in:
- lib/lotus/view/rendering/layout_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 the references of all the registered layouts. As now the registry is unique at the level of the framework.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(view) ⇒ LayoutRegistry
constructor
private
Initialize the registry.
-
#resolve(context) ⇒ Lotus::Layout, Lotus::View::Rendering::NullTemplate
private
Returns the layout for the given context.
Constructor Details
#initialize(view) ⇒ LayoutRegistry
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.
Initialize the registry
31 32 33 34 35 |
# File 'lib/lotus/view/rendering/layout_registry.rb', line 31 def initialize(view) @registry = {} @view = view prepare! end |
Instance Method Details
#resolve(context) ⇒ Lotus::Layout, Lotus::View::Rendering::NullTemplate
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 layout for the given context.
51 52 53 |
# File 'lib/lotus/view/rendering/layout_registry.rb', line 51 def resolve(context) @registry.fetch(format(context)) { NullTemplate.new } end |