Class: Fastr::Template::Erubis

Inherits:
Object
  • Object
show all
Defined in:
lib/fastr/template/erubis.rb

Defined Under Namespace

Modules: Mixin

Class Method Summary collapse

Class Method Details

.result(tpl_path, _binding, cache_template) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/fastr/template/erubis.rb', line 7

def self.result(tpl_path, _binding, cache_template)
  eruby = Fastr::Template::TEMPLATE_CACHE[tpl_path]
  unless eruby and cache_template
    eruby = ::Erubis::Eruby.new(File.read("app/views/#{tpl_path}"))
    Fastr::Template::TEMPLATE_CACHE[tpl_path] = eruby
  end
  eruby.result(_binding)
end