Skip to content

Instantly share code, notes, and snippets.

@troelskn troelskn/table_print.rb
Last active Jul 11, 2019

What would you like to do?
# takes an array of hashes and prints as a table on the console
def table_print(rows)
table = [] + { |v| }
sizes = { |row| }
puts { |row| { |txt, idx| txt.rjust(sizes[idx]) }.join("\t") }.join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.