module Templight
Constants
- VERSION
Public Class Methods
configure(options={"path" => @template_path})
click to toggle source
# File lib/templight.rb, line 14 def self.configure(options={"path" => @template_path}) @template_path = options["path"] end
render(filename, options={})
click to toggle source
# File lib/templight.rb, line 18 def self.render(filename, options={}) template_string = File.read(File.join(@template_path, filename)) template = ERB.new template_string params = ErbBinding.new(options) return template.result(params.get_binding) end