class OoxmlParser::CustomFilters

Class for ‘CustomFilters` data

Attributes

and[R]

@return [Integer] and value

filters_array[R]

@return [Array<CustomFilter>] list of filters array

Public Class Methods

new(parent: nil) click to toggle source
Calls superclass method OoxmlParser::OOXMLDocumentObject::new
# 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

Public Instance Methods

[](key) click to toggle source

@return [Array, CustomFilter] accessor

# 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) click to toggle source

Parse CustomFilters data @param [Nokogiri::XML:Element] node with CustomFilters data @return [CustomFilters] value of CustomFilters data

# 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