Module: HQMF2::Generator
- Defined in:
- lib/hqmf-generator/hqmf-generator.rb
Defined Under Namespace
Classes: ErbContext, ModelProcessor
Class Method Summary collapse
Class Method Details
.render_template(name, params) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/hqmf-generator/hqmf-generator.rb', line 4 def self.render_template(name, params) template_path = File.(File.join('..', "#{name}.xml.erb"), __FILE__) template_str = File.read(template_path) template = ERB.new(template_str, nil, '-', "_templ#{HQMF::Counter.instance.next}") context = ErbContext.new(params) template.result(context.get_binding) end |