Sha256: 73358b2fa73b0ee45ecf57d198cec95c6743d29a3846332267a6efb0dbccd709

Contents?: true

Size: 800 Bytes

Versions: 12

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing <protection> tag
  class Protection < OOXMLDocumentObject
    # @return [True, False] Specifies if cell is locked
    attr_reader :locked
    # @return [True, False] Specifies if formulas in cell are hidden
    attr_reader :hidden

    def initialize(parent: nil)
      @locked = true
      @hidden = false
      super
    end

    # Parse Protection data
    # @param [Nokogiri::XML:Element] node with Protection data
    # @return [Sheet] value of Protection
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'locked'
          @locked = attribute_enabled?(value)
        when 'hidden'
          @hidden = attribute_enabled?(value)
        end
      end
      self
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ooxml_parser-0.33.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.32.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.31.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.30.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.29.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.28.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.27.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.26.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.25.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.24.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.23.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.22.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/cell_style/protection.rb