diff options
| author | Randy Morgan <[email protected]> | 2012-04-01 00:35:26 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-04-01 00:35:26 +0900 |
| commit | 22a341841f191a5aa00e87b1f166b4f25cc67f0a (patch) | |
| tree | 505f46708d5cac7d33d0dd6679c125e2eb819075 /lib/axlsx/workbook/worksheet/col.rb | |
| parent | bb2117ba17297e02a0fc6d5ad5a22462e72a9a79 (diff) | |
| download | caxlsx-22a341841f191a5aa00e87b1f166b4f25cc67f0a.tar.gz caxlsx-22a341841f191a5aa00e87b1f166b4f25cc67f0a.zip | |
part way through changing all serialization to use string concatenation prior to dropping Nokogiri dep in production.
Diffstat (limited to 'lib/axlsx/workbook/worksheet/col.rb')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/col.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/axlsx/workbook/worksheet/col.rb b/lib/axlsx/workbook/worksheet/col.rb index ccf4dfaf..7a34ad40 100644 --- a/lib/axlsx/workbook/worksheet/col.rb +++ b/lib/axlsx/workbook/worksheet/col.rb @@ -64,13 +64,13 @@ module Axlsx @outlineLevel = v end - # @see Col#phonetic - def phonetic=(v) + # @see Col#phonetic + def phonetic=(v) Axlsx.validate_boolean(v) @phonetic = v end - # @see Col#style + # @see Col#style def style=(v) Axlsx.validate_unsigned_int(v) @style = v @@ -103,10 +103,11 @@ module Axlsx end # Serialize this columns data to an xml string + # @param [String] str # @return [String] def to_xml_string(str = '') attrs = self.instance_values.reject{ |key, value| value == nil } - str << '<col ' << attrs.map { |key, value| "#{key}='#{value}' " }.join << '/>' + str << '<col ' << attrs.map { |key, value| '' << key << '="' << value.to_s << '"' }.join(' ') << '/>' end end |
