Sha256: 12ba0643704bf2223e142c5bee4764f3c4e3a0c55e4fd14c16004edff005bf93

Contents?: true

Size: 1.32 KB

Versions: 20

Compression:

Stored size: 1.32 KB

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing <workbookProtection> tag
  class WorkbookProtection < OOXMLDocumentObject
    # @return [True, False] Specifies if workbook structure is protected
    attr_reader :lock_structure
    # @return [String] name of hashing algorithm
    attr_reader :workbook_algorithm_name
    # @return [String] hash value for the password
    attr_reader :workbook_hash_value
    # @return [String] salt value for the password
    attr_reader :workbook_salt_value
    # @return [Integer] number of times the hashing function shall be iteratively run
    attr_reader :workbook_spin_count

    # Parse WorkbookProtection data
    # @param [Nokogiri::XML:Element] node with WorkbookProtection data
    # @return [Sheet] value of WorkbookProtection
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'lockStructure'
          @lock_structure = attribute_enabled?(value)
        when 'workbookAlgorithmName'
          @workbook_algorithm_name = value.value.to_s
        when 'workbookHashValue'
          @workbook_hash_value = value.value.to_s
        when 'workbookSaltValue'
          @workbook_salt_value = value.value.to_s
        when 'workbookSpinCount'
          @workbook_spin_count = value.value.to_i
        end
      end
      self
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.37.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.36.1 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.36.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.35.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.34.2 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.34.1 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.34.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.33.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.32.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.31.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.30.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.29.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.28.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.27.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.26.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.25.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.24.0 lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
ooxml_parser-0.23.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_protection.rb
ooxml_parser-0.22.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_protection.rb