5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/axlsx_enhanced/helpers/injections/cell.rb', line 5
def smart_style=(value)
return if value.nil?
sheet = self.row.worksheet
book = sheet.workbook
if value.is_a? Array
new_style = {}
value.each do |v|
s = sheet.smart_styles.find(v.to_sym)
new_style.deep_merge! s.properties
end
else
new_style = sheet.smart_styles.find(value).properties
end
style_id = book.styles.add_style new_style
self.style = style_id
return style_id
end
|