diff options
| author | Paul Kmiec <[email protected]> | 2023-05-04 16:31:08 -0700 |
|---|---|---|
| committer | Paul Kmiec <[email protected]> | 2023-05-04 18:02:55 -0700 |
| commit | fabe8cb2571c8865270247ca78ddc01d493a9ee1 (patch) | |
| tree | 27fe0b0df8c9bec8f746d92a0d128cad197027b2 /lib/axlsx/content_type | |
| parent | fef93ec8ae2caf8a3f8310dbf8101c103e5905e4 (diff) | |
| download | caxlsx-fabe8cb2571c8865270247ca78ddc01d493a9ee1.tar.gz caxlsx-fabe8cb2571c8865270247ca78ddc01d493a9ee1.zip | |
Fix tests / code to work with frozen string literals
Diffstat (limited to 'lib/axlsx/content_type')
| -rw-r--r-- | lib/axlsx/content_type/abstract_content_type.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/content_type/content_type.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/content_type/default.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/content_type/override.rb | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/axlsx/content_type/abstract_content_type.rb b/lib/axlsx/content_type/abstract_content_type.rb index dfb7dd91..58ca8b2c 100644 --- a/lib/axlsx/content_type/abstract_content_type.rb +++ b/lib/axlsx/content_type/abstract_content_type.rb @@ -22,7 +22,7 @@ module Axlsx alias :ContentType= :content_type= # Serialize the contenty type to xml - def to_xml_string(node_name = '', str = '') + def to_xml_string(node_name = '', str = +'') str << "<#{node_name} " str << Axlsx.instance_values_for(self).map { |key, value| Axlsx::camel(key) << '="' << value.to_s << '"' }.join(' ') str << '/>' diff --git a/lib/axlsx/content_type/content_type.rb b/lib/axlsx/content_type/content_type.rb index ead50713..15751b17 100644 --- a/lib/axlsx/content_type/content_type.rb +++ b/lib/axlsx/content_type/content_type.rb @@ -14,9 +14,9 @@ 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 << ('<Types xmlns="' << XML_NS_T << '">') + str << (+'<Types xmlns="' << XML_NS_T << '">') each { |type| type.to_xml_string(str) } str << '</Types>' end diff --git a/lib/axlsx/content_type/default.rb b/lib/axlsx/content_type/default.rb index ad215070..16189fc6 100644 --- a/lib/axlsx/content_type/default.rb +++ b/lib/axlsx/content_type/default.rb @@ -16,7 +16,7 @@ module Axlsx alias :Extension= :extension= # Serializes this object to xml - def to_xml_string(str = '') + def to_xml_string(str = +'') super(NODE_NAME, str) end end diff --git a/lib/axlsx/content_type/override.rb b/lib/axlsx/content_type/override.rb index fd98a803..be45db3c 100644 --- a/lib/axlsx/content_type/override.rb +++ b/lib/axlsx/content_type/override.rb @@ -16,7 +16,7 @@ module Axlsx alias :PartName= :part_name= # Serializes this object to xml - def to_xml_string(str = '') + def to_xml_string(str = +'') super(NODE_NAME, str) end end |
