Class: OoxmlParser::FilterColumn
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::FilterColumn
- Defined in:
- lib/ooxml_parser/xlsx_parser/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
-
#custom_filters ⇒ CustomFilters
readonly
List of filters.
-
#show_button ⇒ True, False
Flag indicating whether the filter button is visible.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ FilterColumn
constructor
A new instance of FilterColumn.
-
#parse(node) ⇒ FilterColumn
Parse FilterColumn data.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ FilterColumn
Returns a new instance of FilterColumn.
15 16 17 18 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column.rb', line 15 def initialize(parent: nil) @show_button = true super end |
Instance Attribute Details
#custom_filters ⇒ CustomFilters (readonly)
Returns list of filters.
13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column.rb', line 13 def custom_filters @custom_filters end |
#show_button ⇒ True, False
Returns Flag indicating whether the filter button is visible.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column.rb', line 11 def @show_button end |
Instance Method Details
#parse(node) ⇒ FilterColumn
Parse FilterColumn data
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column.rb', line 23 def parse(node) node.attributes.each do |key, value| case key when 'showButton' @show_button = attribute_enabled?(value) end end node.xpath('*').each do |node_child| case node_child.name when 'customFilters' @custom_filters = CustomFilters.new(parent: self).parse(node_child) end end self end |