Class: Bemer::TemplateList

Inherits:
DefaultTemplateList show all
Defined in:
lib/bemer/template_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(view, path, cached: false, prefix: true, **options) ⇒ TemplateList

Returns a new instance of TemplateList.



7
8
9
10
11
12
# File 'lib/bemer/template_list.rb', line 7

def initialize(view, path, cached: false, prefix: true, **options)
  super(view, cached)

  @options = options
  @path    = build_full_path(prefix, path)
end

Instance Method Details

#compileObject



14
15
16
17
18
19
20
21
22
# File 'lib/bemer/template_list.rb', line 14

def compile
  super

  add_default_templates

  view.render(template: template, locals: { **options })
ensure
  remove_template_catalog!
end