rgviz 0.47 → 0.48

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rgviz/table_builder.rb +20 -0
  2. metadata +2 -1
@@ -0,0 +1,20 @@
1
+ module Rgviz
2
+ class TableBuilder
3
+ def initialize(columns = [])
4
+ @table = Rgviz::Table.new
5
+ columns.each do |column|
6
+ @table.cols << Rgviz::Column.new(column)
7
+ end
8
+ end
9
+
10
+ def table
11
+ @table
12
+ end
13
+
14
+ def add_row(*values)
15
+ @table.rows << Rgviz::Row.new(
16
+ :c => values.map { |value| Rgviz::Cell.new(:v => value) }
17
+ )
18
+ end
19
+ end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgviz
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.47'
4
+ version: '0.48'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,7 @@ files:
27
27
  - lib/rgviz/token.rb
28
28
  - lib/rgviz/visitor.rb
29
29
  - lib/rgviz/table.rb
30
+ - lib/rgviz/table_builder.rb
30
31
  - spec/rgviz/lexer_spec.rb
31
32
  - spec/rgviz/parser_spec.rb
32
33
  homepage: http://code.google.com/p/rgviz