From c2a20d2fdef43cf2967919295ba7cf6ecffe57fc Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 25 Jul 2016 21:46:07 -0400 Subject: add Template#run(io, args) --- src/guff/template.cr | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.3