Sha256: 6b20031bc11e4f1b0d02232af892339cc2d569ecab52212aaa7a78623ff295d8

Contents?: true

Size: 1.16 KB

Versions: 19

Compression:

Stored size: 1.16 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)
      @show_gridlines = true
      @show_row_column_headers = true
      super
    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

19 entries across 19 versions & 1 rubygems

Version Path
ooxml_parser-0.20.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.19.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.18.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.18.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.17.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.16.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.15.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.14.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.14.1-mingw32 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.14.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.14.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.13.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.12.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.12.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.12.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.11.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.10.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.9.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
ooxml_parser-0.9.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb