Class: OoxmlParser::TableStyleInfo

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb

Overview

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#nameString

If the style name does not correspond to the name of a table style then the spreadsheet application should use default style. The possible values for this attribute are defined by the ST_Xstring simple type (22.9.2.19).

Returns:

  • A string representing the name of the table style to use with this table.



9
10
11
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb', line 9

def name
  @name
end

#show_column_stripesTrue, False

Returns A Boolean indicating whether column stripe formatting is applied.

Returns:

  • A Boolean indicating whether column stripe formatting is applied.



14
15
16
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb', line 14

def show_column_stripes
  @show_column_stripes
end

#show_first_columnTrue, False

Returns A Boolean indicating whether the first column in the table should have the style applied.

Returns:

  • A Boolean indicating whether the first column in the table should have the style applied.



12
13
14
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb', line 12

def show_first_column
  @show_first_column
end

#show_last_columnTrue, False

Returns A Boolean indicating whether the last column in the table should have the style applied.

Returns:

  • A Boolean indicating whether the last column in the table should have the style applied.



16
17
18
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb', line 16

def show_last_column
  @show_last_column
end

#show_row_stripesTrue, False

Returns A Boolean indicating whether row stripe formatting is applied.

Returns:

  • A Boolean indicating whether row stripe formatting is applied.



18
19
20
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb', line 18

def show_row_stripes
  @show_row_stripes
end

Instance Method Details

#parse(node) ⇒ TableStyleInfo

Parse TableStyleInfo data

Parameters:

  • with TableStyleInfo data

Returns:

  • value of TableStyleInfo data



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb', line 23

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'name'
      @name = value.value.to_s
    when 'showColumnStripes'
      @show_column_stripes = attribute_enabled?(value)
    when 'showFirstColumn'
      @show_first_column = attribute_enabled?(value)
    when 'showLastColumn'
      @show_last_column = attribute_enabled?(value)
    when 'showRowStripes'
      @show_row_stripes = attribute_enabled?(value)
    end
  end
  self
end