Class: OoxmlParser::TableStyleInfo

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/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

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

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:

  • (String)

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



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

def name
  @name
end

#show_column_stripesTrue, False

Returns A Boolean indicating whether column stripe formatting is applied.

Returns:

  • (True, False)

    A Boolean indicating whether column stripe formatting is applied.



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

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:

  • (True, False)

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



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

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:

  • (True, False)

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



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

def show_last_column
  @show_last_column
end

#show_row_stripesTrue, False

Returns A Boolean indicating whether row stripe formatting is applied.

Returns:

  • (True, False)

    A Boolean indicating whether row stripe formatting is applied.



20
21
22
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/table_style_info.rb', line 20

def show_row_stripes
  @show_row_stripes
end

Instance Method Details

#parse(node) ⇒ TableStyleInfo

Parse TableStyleInfo data

Parameters:

  • node (Nokogiri::XML:Element)

    with TableStyleInfo data

Returns:



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

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