Class: Hanami::View::Rendering::TemplateFinder Private

Inherits:
TemplatesFinder show all
Defined in:
lib/hanami/view/rendering/template_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 a template for the current view context. It’s used when a template wants to render another template.

See Also:

Since:

  • 0.1.0

Direct Known Subclasses

PartialFinder

Constant Summary

Constants inherited from TemplatesFinder

Hanami::View::Rendering::TemplatesFinder::ENGINES, Hanami::View::Rendering::TemplatesFinder::FORMAT, Hanami::View::Rendering::TemplatesFinder::RECURSIVE

Instance Method Summary collapse

Constructor Details

#initialize(view, options) ⇒ TemplateFinder

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

Parameters:

  • view (Class)

    a view

  • options (Hash)

    the informations about the context

Options Hash (options):

  • :template (String)

    the template file name

  • :format (Symbol)

    the requested format

Since:

  • 0.1.0



24
25
26
27
# File 'lib/hanami/view/rendering/template_finder.rb', line 24

def initialize(view, options)
  super(view)
  @options = options
end

Instance Method Details

#findHanami::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 a template for the current view context



38
39
40
# File 'lib/hanami/view/rendering/template_finder.rb', line 38

def find
  super.first
end