Sha256: 23b65663d1f2406e8c3f2cd86f26cc3e66d4f8382c137ac374062762287e239f
Contents?: true
Size: 407 Bytes
Versions: 7
Compression:
Stored size: 407 Bytes
Contents
class SmallCage::Renderer def initialize(loader) @loader = loader end def render(name, obj) path = @loader.template_path(name) return nil if path.nil? return render_string(path.read, obj) end def render_string(str, obj) erb_class = ERB.new(str, nil, '-').def_class(@loader.erb_base, "erb") result = erb_class.new(@loader, self, obj).erb return result end end
Version data entries
7 entries across 7 versions & 2 rubygems