diff options
-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 |