Sha256: 6cb845844561bfea08c485d06090f3dd38a153dafa41e40b9a5fa36fc97bcb82
Contents?: true
Size: 383 Bytes
Versions: 8
Compression:
Stored size: 383 Bytes
Contents
module Barkdog::TemplateHelper def include_template(template_name, context = {}) tmplt = @context.templates[template_name.to_s] unless tmplt raise "Template `#{template_name}` is not defined" end context_orig = @context @context = @context.merge(context) instance_eval(&tmplt) @context = context_orig end def context @context end end
Version data entries
8 entries across 8 versions & 1 rubygems