13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/content_shaper.rb', line 13
def shape
content = []
unless options[:titles].empty?
content << Tabled::Template::Titles.render(options[:titles], columns_width, options[:framed])
content << (options[:row_separator].to_s * row_length) unless options[:row_separator].nil?
end
content.concat(
data
.each_with_object([]) do |row, enumerator|
enumerator << Tabled::Template::Row.render(row, columns_width, options[:framed])
enumerator << Tabled::Template::RowFooter.render(row, columns_width, options[:framed])
enumerator << (options[:row_separator].to_s * row_length) unless options[:row_separator].nil?
end
.compact
)
content = add_left_and_right_borders(content)
add_top_bottom_borders(content)
end
|