summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet/cell_style.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-04-01 11:58:09 +0900
committerRandy Morgan <[email protected]>2012-04-01 11:58:09 +0900
commit1529fce32449a8454208fded20d83c9ceca810e0 (patch)
tree02f722182fea58a51b8c0a5433221b3a677e80e4 /lib/axlsx/stylesheet/cell_style.rb
parent22a341841f191a5aa00e87b1f166b4f25cc67f0a (diff)
downloadcaxlsx-1529fce32449a8454208fded20d83c9ceca810e0.tar.gz
caxlsx-1529fce32449a8454208fded20d83c9ceca810e0.zip
rebuild all serialization to use string concatenation instead of nokogiri.
Diffstat (limited to 'lib/axlsx/stylesheet/cell_style.rb')
-rw-r--r--lib/axlsx/stylesheet/cell_style.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/axlsx/stylesheet/cell_style.rb b/lib/axlsx/stylesheet/cell_style.rb
index 0a40ab13..22694ae1 100644
--- a/lib/axlsx/stylesheet/cell_style.rb
+++ b/lib/axlsx/stylesheet/cell_style.rb
@@ -7,7 +7,7 @@ module Axlsx
# The name of this cell style
# @return [String]
attr_reader :name
-
+
# The formatting record id this named style utilizes
# @return [Integer]
# @see Axlsx::Xf
@@ -55,6 +55,13 @@ module Axlsx
# @see customBuiltin
def customBuiltin=(v) Axlsx::validate_boolean v; @customBuiltin = v end
+
+ def to_xml_string(str = '')
+ str << '<cellStyle '
+ str << instance_values.map { |key, value| '' << key.to_s << '="' << value.to_s << '"' }.join(' ')
+ str << '/>'
+ end
+
# Serializes the cell style
# @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
# @return [String]