68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/database_documenter/exporters/export_to_word.rb', line 68
def generate_table_columns(docx, klass)
columns_header = ["Attribute", "Description", "Type", "Example of values"]
columns = []
columns_data = table_data.get_columns_data(klass)
columns_data.each do |col|
data = [col[:name]]
if col[:description_generated]
self.generated_cols_count += 1
else
self. += 1
end
broken_cell_para = Caracal::Core::Models::TableCellModel.new do |c|
col[:description].flatten.each do |s|
c.p s
end
end
data << broken_cell_para
data << col[:type]
data << col[:value]
columns << data
end
docx.page
docx.table [columns_header] + columns, border_size: 4 do
cell_style rows[0], background: 'e0e0e0', bold: true
end
end
|