Class: OoxmlParser::WorkbookProtection
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::WorkbookProtection
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb
Overview
Class for parsing <workbookProtection> tag
Instance Attribute Summary collapse
-
#lock_structure ⇒ True, False
readonly
Specifies if workbook structure is protected.
-
#workbook_algorithm_name ⇒ String
readonly
Name of hashing algorithm.
-
#workbook_hash_value ⇒ String
readonly
Hash value for the password.
-
#workbook_salt_value ⇒ String
readonly
Salt value for the password.
-
#workbook_spin_count ⇒ Integer
readonly
Number of times the hashing function shall be iteratively run.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ Sheet
Parse WorkbookProtection data.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#lock_structure ⇒ True, False (readonly)
Returns Specifies if workbook structure is protected.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb', line 7 def lock_structure @lock_structure end |
#workbook_algorithm_name ⇒ String (readonly)
Returns name of hashing algorithm.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb', line 9 def workbook_algorithm_name @workbook_algorithm_name end |
#workbook_hash_value ⇒ String (readonly)
Returns hash value for the password.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb', line 11 def workbook_hash_value @workbook_hash_value end |
#workbook_salt_value ⇒ String (readonly)
Returns salt value for the password.
13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb', line 13 def workbook_salt_value @workbook_salt_value end |
#workbook_spin_count ⇒ Integer (readonly)
Returns number of times the hashing function shall be iteratively run.
15 16 17 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb', line 15 def workbook_spin_count @workbook_spin_count end |
Instance Method Details
#parse(node) ⇒ Sheet
Parse WorkbookProtection data
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_protection.rb', line 20 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 |