Sha256: cfc2d8d707a957b820f5bde08334e89279c84454c954e424473846dd27c922e4

Contents?: true

Size: 1.16 KB

Versions: 28

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module OoxmlParser
  # Parsing `dxfs` tag
  class DifferentialFormattingRecords < OOXMLDocumentObject
    # @return [Array, DifferentialFormattingRecord] list of formatting records
    attr_reader :differential_formatting_records
    # @return [Integer] count of formats
    attr_reader :count

    def initialize(parent: nil)
      @differential_formatting_records = []
      super
    end

    # @return [Array, DifferentialFormattingRecord] accessor
    def [](key)
      @differential_formatting_records[key]
    end

    # Parse DifferentialFormattingRecords data
    # @param [Nokogiri::XML:Element] node with DifferentialFormattingRecords data
    # @return [DifferentialFormattingRecords] value of DifferentialFormattingRecords data
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'count'
          @count = value.value.to_i
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'dxf'
          @differential_formatting_records << DifferentialFormattingRecord.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.37.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.36.1 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.36.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.35.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.34.2 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.34.1 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.34.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.33.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.32.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.31.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.30.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.29.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.28.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.27.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.26.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.25.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.24.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.23.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/differential_formatting_records.rb
ooxml_parser-0.22.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/differential_formatting_records.rb