Class: TableBuilder
- Inherits:
-
Object
- Object
- TableBuilder
- Defined in:
- lib/table_builder.rb
Overview
converts the examples array to a table string
Instance Method Summary collapse
- #generate_table ⇒ Object
-
#initialize(examples, configs) ⇒ TableBuilder
constructor
A new instance of TableBuilder.
Constructor Details
#initialize(examples, configs) ⇒ TableBuilder
Returns a new instance of TableBuilder.
7 8 9 10 |
# File 'lib/table_builder.rb', line 7 def initialize(examples, configs) @examples = examples @configs = configs end |
Instance Method Details
#generate_table ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/table_builder.rb', line 12 def generate_table Terminal::Table.new do |t| t.headings = @configs.headers t.rows = map_examples(@examples) t.style = @configs.table_style end end |