Sha256: 4e61552c233879fee6bf917c0532886915a0bb327ca51580bbb2b97bf97c2a85

Contents?: true

Size: 956 Bytes

Versions: 28

Compression:

Stored size: 956 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for storing data of chartsheets files
  class Chartsheet < OOXMLDocumentObject
    # @return [Array, SheetView] array of views
    attr_accessor :sheet_views

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

    # Parse Chartsheet object
    # @param file [String] file to parse
    # @return [Chartsheet] result of parsing
    def parse(file)
      OOXMLDocumentObject.add_to_xmls_stack(OOXMLDocumentObject.root_subfolder + file)
      doc = parse_xml(OOXMLDocumentObject.current_xml)
      node = doc.xpath('//xmlns:chartsheet').first
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'sheetViews'
          node_child.xpath('*').each do |view_child|
            @sheet_views << SheetView.new(parent: self).parse(view_child)
          end
        end
      end
      OOXMLDocumentObject.xmls_stack.pop
      self
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ooxml_parser-0.29.0 lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb
ooxml_parser-0.28.0 lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb
ooxml_parser-0.27.0 lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb
ooxml_parser-0.26.0 lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb
ooxml_parser-0.25.0 lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb
ooxml_parser-0.24.0 lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb
ooxml_parser-0.23.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.22.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.21.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.20.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.19.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.18.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.18.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.17.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.16.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.15.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.14.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.14.1-mingw32 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.14.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
ooxml_parser-0.14.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb