Ruby Gem to print a list of objects to a console as a table
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
README.md
Rakefile
tablecon-0.0.1.gem
tablecon.gemspec

README.md

Tablecon

A simple library that is able to print an object as a table.

Example:

class Person
  def initialize name, age
    @name = name
    @age = age
  end
end

people = [ Person.new("Kurt", 30), Person.new("Eddie", 45), Person.new("Scott", 40) ]

puts Tablecon::Table.new people

The result will be:

+-------+-----+
| Name  | Age |
+-------+-----+
| Kurt  | 30  |
+-------+-----+
| Eddie | 45  |
+-------+-----+
| Scott | 40  |
+-------+-----+