Class: OoxmlParser::PivotTableStyleInfo

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_table_style_info.rb

Overview

Class for parsing <pivotTableStyleInfo> tag

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 (readonly)

Returns name of style.

Returns:

  • (String)

    name of style



7
8
9
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_table_style_info.rb', line 7

def name
  @name
end

#show_column_headerTrue, False (readonly)

Returns show column header.

Returns:

  • (True, False)

    show column header



11
12
13
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_table_style_info.rb', line 11

def show_column_header
  @show_column_header
end

#show_column_stripesTrue, False (readonly)

Returns show column stripes.

Returns:

  • (True, False)

    show column stripes



15
16
17
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_table_style_info.rb', line 15

def show_column_stripes
  @show_column_stripes
end

#show_last_columnTrue, False (readonly)

Returns show last column.

Returns:

  • (True, False)

    show last column



17
18
19
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_table_style_info.rb', line 17

def show_last_column
  @show_last_column
end

#show_row_headerTrue, False (readonly)

Returns show row header.

Returns:

  • (True, False)

    show row header



9
10
11
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_table_style_info.rb', line 9

def show_row_header
  @show_row_header
end

#show_row_stripesTrue, False (readonly)

Returns show row stripes.

Returns:

  • (True, False)

    show row stripes



13
14
15
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_table_style_info.rb', line 13

def show_row_stripes
  @show_row_stripes
end

Instance Method Details

#parse(node) ⇒ PivotTableStyleInfo

Parse ‘<pivotTableStyleInfo>` tag

Parameters:

  • node (Nokogiri::XML:Element)

    with PivotTableStyleInfo data

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_table_style_info.rb', line 22

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'name'
      @name = value.value.to_s
    when 'showRowHeaders'
      @show_row_header = attribute_enabled?(value)
    when 'showColHeaders'
      @show_column_header = attribute_enabled?(value)
    when 'showRowStripes'
      @show_row_stripes = attribute_enabled?(value)
    when 'showColStripes'
      @show_column_stripes = attribute_enabled?(value)
    when 'showLastColumn'
      @show_last_column = attribute_enabled?(value)
    end
  end
  self
end