class Wright::DSL::Util
DSL
helper class.
Public Instance Methods
render_erb(template, hash)
click to toggle source
Renders an ERB template using the supplied hash. @param template [String] the template @param hash [Hash] the hash @return [String] the rendered template
# File lib/wright/dsl.rb, line 39 def render_erb(template, hash) Wright::Util::ErbRenderer.new(hash).render(template) end
render_file(filename, hash)
click to toggle source
Renders a template file according to the file's extension using the supplied hash. Currently supports ERB (.erb
) and Mustache (.mustache
).
@param filename [String] the filename of the template file @param hash [Hash] the hash @return [String] the rendered template
# File lib/wright/dsl.rb, line 58 def render_file(filename, hash) Wright::Util::FileRenderer.new(hash).render(filename) end
render_mustache(template, hash)
click to toggle source
Renders a mustache template using the supplied hash. @param template [String] the template @param hash [Hash] the hash @return [String] the rendered template
# File lib/wright/dsl.rb, line 47 def render_mustache(template, hash) Wright::Util::MustacheRenderer.new(hash).render(template) end