summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/cell_serializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/axlsx/workbook/worksheet/cell_serializer.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/cell_serializer.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell_serializer.rb b/lib/axlsx/workbook/worksheet/cell_serializer.rb
index b1ac8207..15113fcd 100644
--- a/lib/axlsx/workbook/worksheet/cell_serializer.rb
+++ b/lib/axlsx/workbook/worksheet/cell_serializer.rb
@@ -7,7 +7,7 @@ module Axlsx
# @param [Integer] column_index The index of the cell's column
# @param [String] str The string to apend serialization to.
# @return [String]
- def to_xml_string(row_index, column_index, cell, str='')
+ def to_xml_string(row_index, column_index, cell, str = '')
str << ('<c r="' << Axlsx::cell_r(column_index, row_index) << '" s="' << cell.style.to_s << '" ')
return str << '/>' if cell.value.nil?
method = cell.type
@@ -21,7 +21,7 @@ module Axlsx
def run_xml_string(cell, str = '')
if cell.is_text_run?
valid = RichTextRun::INLINE_STYLES - [:value, :type]
- data = Hash[Axlsx.instance_values_for(cell).map{ |k, v| [k.to_sym, v] }]
+ data = Hash[Axlsx.instance_values_for(cell).map { |k, v| [k.to_sym, v] }]
data = data.select { |key, value| valid.include?(key) && !value.nil? }
RichText.new(cell.value.to_s, data).to_xml_string(str)
elsif cell.contains_rich_text?
@@ -36,7 +36,7 @@ module Axlsx
# @param [Cell] cell The cell that is being serialized
# @param [String] str The string the serialized content will be appended to.
# @return [String]
- def iso_8601(cell, str='')
+ def iso_8601(cell, str = '')
value_serialization 'd', cell.value, str
end
@@ -44,7 +44,7 @@ module Axlsx
# @param [Cell] cell The cell that is being serialized
# @param [String] str The string the serialized content will be appended to.
# @return [String]
- def date(cell, str='')
+ def date(cell, str = '')
value_serialization false, DateTimeConverter::date_to_serial(cell.value).to_s, str
end
@@ -52,7 +52,7 @@ module Axlsx
# @param [Cell] cell The cell that is being serialized
# @param [String] str The string the serialized content will be appended to.
# @return [String]
- def time(cell, str='')
+ def time(cell, str = '')
value_serialization false, DateTimeConverter::time_to_serial(cell.value).to_s, str
end
@@ -60,7 +60,7 @@ module Axlsx
# @param [Cell] cell The cell that is being serialized
# @param [String] str The string the serialized content will be appended to.
# @return [String]
- def boolean(cell, str='')
+ def boolean(cell, str = '')
value_serialization 'b', cell.value.to_s, str
end
@@ -68,7 +68,7 @@ module Axlsx
# @param [Cell] cell The cell that is being serialized
# @param [String] str The string the serialized content will be appended to.
# @return [String]
- def float(cell, str='')
+ def float(cell, str = '')
numeric cell, str
end
@@ -84,7 +84,7 @@ module Axlsx
# @param [Cell] cell The cell that is being serialized
# @param [String] str The string the serialized content will be appended to.
# @return [String]
- def formula_serialization(cell, str='')
+ def formula_serialization(cell, str = '')
str << ('t="str"><f>' << cell.clean_value.to_s.sub('=', '') << '</f>')
str << ('<v>' << cell.formula_value.to_s << '</v>') unless cell.formula_value.nil?
end
@@ -93,7 +93,7 @@ module Axlsx
# @param [Cell] cell The cell that is being serialized
# @param [String] str The string the serialized content will be appended to.
# @return [String]
- def array_formula_serialization(cell, str='')
+ def array_formula_serialization(cell, str = '')
str << ('t="str">' << '<f t="array" ref="' << cell.r << '">' << cell.clean_value.to_s.sub('{=', '').sub(/}$/, '') << '</f>')
str << ('<v>' << cell.formula_value.to_s << '</v>') unless cell.formula_value.nil?
end
@@ -112,7 +112,7 @@ module Axlsx
# @param [Cell] cell The cell that is being serialized
# @param [String] str The string the serialized content will be appended to.
# @return [String]
- def string(cell, str='')
+ def string(cell, str = '')
if cell.is_array_formula?
array_formula_serialization cell, str
elsif cell.is_formula?