diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-08 11:53:12 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-04-08 11:53:12 +0200 |
| commit | 55526805cf28cc91a22df5811b26cd23bdefa8d3 (patch) | |
| tree | 2cbc6403b385078b0ed5e275c49f0c60522bdd16 /lib/axlsx/workbook/worksheet/table.rb | |
| parent | acf00d356494ef504c3de0e4a0db6b25f2bd7636 (diff) | |
| download | caxlsx-55526805cf28cc91a22df5811b26cd23bdefa8d3.tar.gz caxlsx-55526805cf28cc91a22df5811b26cd23bdefa8d3.zip | |
Fix space-related offenses
- Layout/SpaceAfterComma
- Layout/SpaceAroundEqualsInParameterDefault
- Layout/SpaceAroundOperators
- Layout/SpaceBeforeBlockBraces
- Layout/SpaceInsideBlockBraces
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideParens
Diffstat (limited to 'lib/axlsx/workbook/worksheet/table.rb')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/table.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/axlsx/workbook/worksheet/table.rb b/lib/axlsx/workbook/worksheet/table.rb index 5053c5fd..4f446491 100644 --- a/lib/axlsx/workbook/worksheet/table.rb +++ b/lib/axlsx/workbook/worksheet/table.rb @@ -10,13 +10,13 @@ module Axlsx # @param [Worksheet] sheet The sheet containing the table data. # @option options [Cell, String] name # @option options [TableStyle] style - def initialize(ref, sheet, options={}) + def initialize(ref, sheet, options = {}) @ref = ref @sheet = sheet @style = nil @sheet.workbook.tables << self @table_style_info = TableStyleInfo.new(options[:style_info]) if options[:style_info] - @name = "Table#{index+1}" + @name = "Table#{index + 1}" parse_options options yield self if block_given? end @@ -42,7 +42,7 @@ module Axlsx # The part name for this table # @return [String] def pn - "#{TABLE_PN % (index+1)}" + "#{TABLE_PN % (index + 1)}" end # The relationship id for this table. @@ -73,12 +73,12 @@ module Axlsx # @return [String] 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 << ('<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 << '"/>') + header_cells.each_with_index do |cell, index| + str << ('<tableColumn id ="' << (index + 1).to_s << '" name="' << cell.clean_value << '"/>') end str << '</tableColumns>' table_style_info.to_xml_string(str) |
