summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet/num_fmt.rb
diff options
context:
space:
mode:
authorEvan Hallmark <[email protected]>2016-11-07 11:19:12 -0800
committerEvan Hallmark <[email protected]>2016-11-07 11:19:12 -0800
commit31a4e6cb13d139c7d54038ecb204b4ae1b152c61 (patch)
tree797d1203f0175ce71ea9169d9c3281f147cc8ee4 /lib/axlsx/stylesheet/num_fmt.rb
parent731639b7d8871e79e96167b64c83f55e06bf78f6 (diff)
downloadcaxlsx-31a4e6cb13d139c7d54038ecb204b4ae1b152c61.tar.gz
caxlsx-31a4e6cb13d139c7d54038ecb204b4ae1b152c61.zip
Override NumFmt serialized_attributes to ovid removing underscores
Diffstat (limited to 'lib/axlsx/stylesheet/num_fmt.rb')
-rw-r--r--lib/axlsx/stylesheet/num_fmt.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/axlsx/stylesheet/num_fmt.rb b/lib/axlsx/stylesheet/num_fmt.rb
index 8276ba18..1072d18a 100644
--- a/lib/axlsx/stylesheet/num_fmt.rb
+++ b/lib/axlsx/stylesheet/num_fmt.rb
@@ -73,5 +73,14 @@ module Axlsx
serialized_tag('numFmt', str)
end
+ # Override to avoid removing underscores
+ def serialized_attributes(str = '', additional_attributes = {})
+ attributes = declared_attributes.merge! additional_attributes
+ attributes.each do |key, value|
+ str << "#{Axlsx.camel(key, false)}=\"#{Axlsx.booleanize(value)}\" "
+ end
+ str
+ end
+
end
end