summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/table.rb
diff options
context:
space:
mode:
authorPaul Kmiec <[email protected]>2023-05-04 16:31:08 -0700
committerPaul Kmiec <[email protected]>2023-05-04 18:02:55 -0700
commitfabe8cb2571c8865270247ca78ddc01d493a9ee1 (patch)
tree27fe0b0df8c9bec8f746d92a0d128cad197027b2 /lib/axlsx/workbook/worksheet/table.rb
parentfef93ec8ae2caf8a3f8310dbf8101c103e5905e4 (diff)
downloadcaxlsx-fabe8cb2571c8865270247ca78ddc01d493a9ee1.tar.gz
caxlsx-fabe8cb2571c8865270247ca78ddc01d493a9ee1.zip
Fix tests / code to work with frozen string literals
Diffstat (limited to 'lib/axlsx/workbook/worksheet/table.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/table.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/axlsx/workbook/worksheet/table.rb b/lib/axlsx/workbook/worksheet/table.rb
index 70f27575..430ef489 100644
--- a/lib/axlsx/workbook/worksheet/table.rb
+++ b/lib/axlsx/workbook/worksheet/table.rb
@@ -73,14 +73,14 @@ module Axlsx
# Serializes the object
# @param [String] str
# @return [String]
- def to_xml_string(str = '')
+ def to_xml_string(str = +'')
str << '<?xml version="1.0" encoding="UTF-8"?>'
- str << ('<table xmlns="' << XML_NS << '" id="' << (index + 1).to_s << '" name="' << @name << '" displayName="' << @name.gsub(/\s/, '_') << '" ')
- str << ('ref="' << @ref << '" totalsRowShown="0">')
- str << ('<autoFilter ref="' << @ref << '"/>')
- str << ('<tableColumns count="' << header_cells.length.to_s << '">')
+ str << (+'<table xmlns="' << XML_NS << '" id="' << (index + 1).to_s << '" name="' << @name << '" displayName="' << @name.gsub(/\s/, '_') << '" ')
+ str << (+'ref="' << @ref << '" totalsRowShown="0">')
+ str << (+'<autoFilter ref="' << @ref << '"/>')
+ str << (+'<tableColumns count="' << header_cells.length.to_s << '">')
header_cells.each_with_index do |cell, index|
- str << ('<tableColumn id ="' << (index + 1).to_s << '" name="' << cell.clean_value << '"/>')
+ str << (+'<tableColumn id ="' << (index + 1).to_s << '" name="' << cell.clean_value << '"/>')
end
str << '</tableColumns>'
table_style_info.to_xml_string(str)