Module: WalrusLang::Template

Defined in:
lib/opswalrus/walrus_lang.rb

Instance Method Summary collapse

Instance Method Details

#render(binding) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/opswalrus/walrus_lang.rb', line 14

def render(binding)
  s = StringIO.new
  if mustache = capture(:mustache)
    s << capture(:pre).value
    s << mustache.render(binding)
    s << capture(:post).value
  else
    s << capture(:fallthrough).value
  end
  s.string
end