short hash, inline like for array. with curly braces off course

This commit is contained in:
Torsten Ruger
2014-08-27 14:46:34 +03:00
parent 6343e644b4
commit fc9615a649
2 changed files with 11 additions and 3 deletions

View File

@ -22,7 +22,15 @@ module Sof
end
end
def short_out(io,level)
long_out(io,level)
io.write("{")
children.each_with_index do |child , i|
key , val = child
key.out(io , level + 1)
io.write " => "
val.out(io , level + 1)
io.write ", " unless (i+1) == children.length
end
io.write("}")
end
def long_out io , level
indent = " " * level