Class: RgGen::ERBEngine

Inherits:
OutputBase::TemplateEngine show all
Defined in:
lib/rggen/core_components/erb_engine.rb

Instance Method Summary collapse

Methods inherited from OutputBase::TemplateEngine

#process_template

Instance Method Details

#file_extensionObject



3
4
5
# File 'lib/rggen/core_components/erb_engine.rb', line 3

def file_extension
  :erb
end

#parse_template(path) ⇒ Object



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

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

#render(context, template) ⇒ Object



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

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