Sha256: ce63fb82dc17883620ae2da81b5d8b4e0471dbc3188b599d88b3833321c0d580
Contents?: true
Size: 1.01 KB
Versions: 40
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true require_relative 'custom_filters/custom_filter' module OoxmlParser # Class for `CustomFilters` data class CustomFilters < OOXMLDocumentObject # @return [Integer] and value attr_reader :and # @return [Array<CustomFilter>] list of filters array attr_reader :filters_array def initialize(parent: nil) @filters_array = [] super end # @return [Array, CustomFilter] accessor def [](key) @filters_array[key] end # Parse CustomFilters data # @param [Nokogiri::XML:Element] node with CustomFilters data # @return [CustomFilters] value of CustomFilters data 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 end end
Version data entries
40 entries across 40 versions & 1 rubygems