Class: ReportEngine::Table
- Inherits:
-
Object
- Object
- ReportEngine::Table
show all
- Defined in:
- lib/report_engine/table.rb
Instance Method Summary
collapse
Constructor Details
#initialize(canvas, options) ⇒ Table
Returns a new instance of Table.
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/report_engine/table.rb', line 3
def initialize(canvas, options)
@canvas = canvas
@data = options[:data].clone
@axis_title= options[:axis_title] || "Axes"
@x_label = options[:x_label]
@y_label = options[:y_label]
= options[:x_headers]
= options[:y_headers]
@border_color = options[:border_color] || '000000'
@row_colors = options[:row_colors] || []
@column_widths = options[:column_widths] || {}
@legends = options[:legends]
end
|
Instance Method Details
25
26
27
28
|
# File 'lib/report_engine/table.rb', line 25
def
@data.insert 0,
end
|
17
18
19
20
21
22
23
|
# File 'lib/report_engine/table.rb', line 17
def
if !.nil? && !.empty?
@data.each_with_index do |line, i|
line.insert(0, [i] )
end
end
end
|
#data ⇒ Object
30
31
32
|
# File 'lib/report_engine/table.rb', line 30
def data
return @data
end
|