Class: Producer::Core::Template::ERBRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/producer/core/template/erb_renderer.rb

Class Method Summary collapse

Class Method Details

.render(file_path, variables = {}) ⇒ Object



6
7
8
9
10
# File 'lib/producer/core/template/erb_renderer.rb', line 6

def render file_path, variables = {}
  tpl = ERB.new(File.read(file_path), nil, '-')
  tpl.filename = file_path.to_s
  tpl.result build_erb_binding variables
end