Class: AssociationReporter::Template
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- AssociationReporter::Template
- Defined in:
- lib/association-reporter/template.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.render(template, locals) ⇒ Object
12 13 14 |
# File 'lib/association-reporter/template.rb', line 12 def self.render(template, locals) Template.new(locals).render(template) end |
Instance Method Details
#render(template, template_directory = AssociationReporter::TEMPLATES) ⇒ Object
7 8 9 10 |
# File 'lib/association-reporter/template.rb', line 7 def render(template, template_directory=AssociationReporter::TEMPLATES) templ_string = File.read(File.join(template_directory, template)) ERB.new(templ_string, 0, '-').result(binding) end |