Class: Hanami::View::Rendering::NullTemplate Private
- Inherits:
-
Object
- Object
- Hanami::View::Rendering::NullTemplate
- Defined in:
- lib/hanami/view/rendering/null_template.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.
Null Object pattern for layout template
It’s used when a layout doesn’t have an associated template.
A common scenario is for non-html requests. Usually we have a template for the application layout (eg ‘templates/application.html.erb`), but we don’t use to have the template for JSON requests (eg ‘templates/application.json.erb`). Because most of the times, we only return the output of the view.
Instance Method Summary collapse
-
#render(scope, locals = {}) {|Proc| ... } ⇒ String
private
Render the layout template.
Instance Method Details
#render(scope, locals = {}) {|Proc| ... } ⇒ String
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.
Render the layout template
77 78 79 |
# File 'lib/hanami/view/rendering/null_template.rb', line 77 def render(scope, locals = {}) yield end |