Class: RgGen::Core::OutputBase::ERBEngine

Inherits:
TemplateEngine show all
Defined in:
lib/rggen/core/output_base/erb_engine.rb

Instance Method Summary collapse

Methods inherited from TemplateEngine

#process_template

Instance Method Details

#file_extensionObject



7
8
9
# File 'lib/rggen/core/output_base/erb_engine.rb', line 7

def file_extension
  :erb
end

#parse_template(path) ⇒ Object



11
12
13
# File 'lib/rggen/core/output_base/erb_engine.rb', line 11

def parse_template(path)
  Erubi::Engine.new(File.binread(path), filename: path)
end

#render(context, template) ⇒ Object



15
16
17
# File 'lib/rggen/core/output_base/erb_engine.rb', line 15

def render(context, template)
  context.instance_eval(template.src, template.filename, 1)
end