Class: Hanami::View::Rendering::TemplatesFinder Private
- Inherits:
-
Object
- Object
- Hanami::View::Rendering::TemplatesFinder
- Defined in:
- lib/hanami/view/rendering/templates_finder.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.
Find templates for a view
Direct Known Subclasses
Constant Summary collapse
- 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
'*'.freeze
- ENGINES =
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 template engines
'*'.freeze
- RECURSIVE =
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.
Recursive pattern
'**'.freeze
Instance Method Summary collapse
-
#find ⇒ Array<Hanami::View::Template>
private
Find all the associated templates to the view.
-
#initialize(view) ⇒ TemplatesFinder
constructor
private
Initialize a finder.
Constructor Details
#initialize(view) ⇒ TemplatesFinder
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 a finder
37 38 39 |
# File 'lib/hanami/view/rendering/templates_finder.rb', line 37 def initialize(view) @view = view end |
Instance Method Details
#find ⇒ Array<Hanami::View::Template>
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.
Find all the associated templates to the view. It recursively looks for templates under the root path of the view, that are matching the template name
71 72 73 74 75 |
# File 'lib/hanami/view/rendering/templates_finder.rb', line 71 def find _find.map do |template| View::Template.new(template, @view.configuration.default_encoding) end end |