Class: Mustache

Inherits:
Object
  • Object
show all
Defined in:
lib/www_app/TO.rb

Defined Under Namespace

Classes: Context, Generator

Instance Method Summary collapse

Instance Method Details

#render(data = template, ctx = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/www_app/TO.rb', line 23

def render(data = template, ctx = {})
  ctx = data
  tpl = templateify(template)

  begin
    context.push(ctx)
    tpl.render(context)
  ensure
    context.pop
  end
end