diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-07-25 21:46:07 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-07-25 21:46:07 -0400 |
commit | c2a20d2fdef43cf2967919295ba7cf6ecffe57fc (patch) | |
tree | 21ac865a00d6ed09fa7e335b8f11c69b27f1ada5 /src | |
parent | dc4de99af4e14ebdd384941e699cbbaacd3636d4 (diff) | |
download | guff-c2a20d2fdef43cf2967919295ba7cf6ecffe57fc.tar.bz2 guff-c2a20d2fdef43cf2967919295ba7cf6ecffe57fc.zip |
add Template#run(io, args)
Diffstat (limited to 'src')
-rw-r--r-- | src/guff/template.cr | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/guff/template.cr b/src/guff/template.cr index 3068669..c784a90 100644 --- a/src/guff/template.cr +++ b/src/guff/template.cr @@ -130,11 +130,15 @@ class Guff::Template @ops = parse(@string) as Array(Ops::Op) end + def run(io : IO, args : Hash(String, String)) + @ops.each do |op| + io << op.run(args) + end + end + def run(args : Hash(String, String)) String.build do |io| - @ops.each do |op| - io << op.run(args) - end + run(io, args) end end |