Class: OoxmlParser::FilterColumn

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

Overview

Class for ‘filterColumn` data The filterColumn collection identifies a particular column in the AutoFilter range and specifies filter information that has been applied to this column.

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, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(parent: nil) ⇒ FilterColumn

Returns a new instance of FilterColumn.



10
11
12
13
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb', line 10

def initialize(parent: nil)
  @show_button = true
  @parent = parent
end

Instance Attribute Details

#show_buttonTrue, False

Returns Flag indicating whether the filter button is visible.

Returns:

  • (True, False)

    Flag indicating whether the filter button is visible.



8
9
10
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb', line 8

def show_button
  @show_button
end

Instance Method Details

#parse(node) ⇒ FilterColumn

Parse FilterColumn data

Parameters:

  • node (Nokogiri::XML:Element)

    with FilterColumn data

Returns:



18
19
20
21
22
23
24
25
26
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb', line 18

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'showButton'
      @show_button = attribute_enabled?(value)
    end
  end
  self
end