Class: OoxmlParser::CustomFilters
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::CustomFilters
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb
Overview
Class for ‘CustomFilters` data
Instance Attribute Summary collapse
-
#and ⇒ Integer
readonly
And value.
-
#filters_array ⇒ Array<CustomFilter>
readonly
List of filters array.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#[](key) ⇒ Array, CustomFilter
Accessor.
-
#initialize(parent: nil) ⇒ CustomFilters
constructor
A new instance of CustomFilters.
-
#parse(node) ⇒ CustomFilters
Parse CustomFilters 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) ⇒ CustomFilters
Returns a new instance of CustomFilters.
12 13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb', line 12 def initialize(parent: nil) @filters_array = [] super end |
Instance Attribute Details
#and ⇒ Integer (readonly)
Returns and value.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb', line 8 def and @and end |
#filters_array ⇒ Array<CustomFilter> (readonly)
Returns list of filters array.
10 11 12 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb', line 10 def filters_array @filters_array end |
Instance Method Details
#[](key) ⇒ Array, CustomFilter
Returns accessor.
18 19 20 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb', line 18 def [](key) @filters_array[key] end |
#parse(node) ⇒ CustomFilters
Parse CustomFilters data
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb', line 25 def parse(node) node.attributes.each do |key, value| case key when 'and' @and = value.value.to_i end end node.xpath('*').each do |node_child| case node_child.name when 'customFilter' @filters_array << CustomFilter.new(parent: self).parse(node_child) end end self end |