Module: Nancy::Render
- Defined in:
- lib/nancy/render.rb
Instance Method Summary collapse
Instance Method Details
#render(template, locals = {}, options = {}, &block) ⇒ Object
6 7 8 9 10 |
# File 'lib/nancy/render.rb', line 6 def render(template, locals = {}, = {}, &block) templates_cache.fetch(template) { Tilt.new(template, ) }.render(self, locals, &block) end |
#templates_cache ⇒ Object
12 13 14 |
# File 'lib/nancy/render.rb', line 12 def templates_cache Thread.current[:templates_cache] ||= Tilt::Cache.new end |