Class: Wright::DSL::Util
- Inherits:
-
Object
- Object
- Wright::DSL::Util
- Defined in:
- lib/wright/dsl.rb
Overview
DSL helper class.
Instance Method Summary collapse
-
#render_erb(template, hash) ⇒ String
Renders an ERB template using the supplied hash.
-
#render_file(filename, hash) ⇒ String
Renders a template file according to the file’s extension using the supplied hash.
-
#render_mustache(template, hash) ⇒ String
Renders a mustache template using the supplied hash.
Instance Method Details
#render_erb(template, hash) ⇒ String
Renders an ERB template using the supplied hash.
39 40 41 |
# File 'lib/wright/dsl.rb', line 39 def render_erb(template, hash) Wright::Util::ErbRenderer.new(hash).render(template) end |
#render_file(filename, hash) ⇒ String
Renders a template file according to the file’s extension using the supplied hash. Currently supports ERB (.erb
) and Mustache (.mustache
).
58 59 60 |
# File 'lib/wright/dsl.rb', line 58 def render_file(filename, hash) Wright::Util::FileRenderer.new(hash).render(filename) end |
#render_mustache(template, hash) ⇒ String
Renders a mustache template using the supplied hash.
47 48 49 |
# File 'lib/wright/dsl.rb', line 47 def render_mustache(template, hash) Wright::Util::MustacheRenderer.new(hash).render(template) end |