Class: Yutani::Template
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Yutani::Template
- Includes:
- Hiera
- Defined in:
- lib/yutani/template.rb
Overview
an openstruct is useful because it lets us take a hash and turn its k/v’s into local variables inside the tmpl
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Hiera
#hiera, init_hiera, lookup, pop, push, scope
Class Method Details
Instance Method Details
#render(path) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/yutani/template.rb', line 17 def render(path) full_path = File.join(Template.templates_path, path) unless File.exists?(full_path) raise TemplateNotFoundError, full_path end ERB.new(File.read(full_path)).result binding end |