Sha256: 94edb81737aaf6bb10a756ad6183e9adb038a66b875a67fd0026238647887522

Contents?: true

Size: 810 Bytes

Versions: 8

Compression:

Stored size: 810 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 = boolean_attribute_value(value)
        when 'hidden'
          @hidden = boolean_attribute_value(value)
        end
      end
      self
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.37.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.36.1 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.36.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.35.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.34.2 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.34.1 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
ooxml_parser-0.34.0 lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb