Sha256: 2ab2bb272b50454414f2e6f6369f8fea63f55344474276e29c4e97eb1dbe7c52

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

require_relative 'sheet_view/pane'
module OoxmlParser
  # Class for `sheetView` data
  class SheetView < OOXMLDocumentObject
    attr_accessor :pane
    # @return [True, False] Flag indicating whether this sheet should display gridlines.
    attr_accessor :show_gridlines
    # @return [True, False] Flag indicating whether the sheet should display row and column headings.
    attr_accessor :show_row_column_headers

    def initialize(parent: nil)
      @parent = parent
      @show_gridlines = true
      @show_row_column_headers = true
    end

    # Parse SheetView object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [SheetView] result of parsing
    def parse(node)
      node.attributes.each_key do |key|
        case key
        when 'showGridLines'
          @show_gridlines = attribute_enabled?(node, key)
        when 'showRowColHeaders'
          @show_row_column_headers = attribute_enabled?(node, key)
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'pane'
          @pane = Pane.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ooxml_parser-0.8.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.8.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.7.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.7.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.7.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.6.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.5.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.5.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb