Class: Hanami::Views::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/ruby3/hanami/views/default.rb

Class Method Summary collapse

Class Method Details

.render(root, template_name, context) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/hanami/ruby3/hanami/views/default.rb', line 6

def self.render(root, template_name, context)
  format   = context[:format]
  template = DefaultTemplateFinder.new(self, root, template_name, format).find

  if template
    new(template, **context).render
  else
    super(context)
  end
end