Class: OoxmlParser::ProtectedRange

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/workbook/worksheet/protected_range.rb

Overview

Class for parsing <protectedRange> tag

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#algorithm_nameString (readonly)

Returns Name of hashing algorithm.

Returns:

  • (String)

    Name of hashing algorithm



7
8
9
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/protected_range.rb', line 7

def algorithm_name
  @algorithm_name
end

#hash_valueString (readonly)

Returns Hash value for the password.

Returns:

  • (String)

    Hash value for the password



9
10
11
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/protected_range.rb', line 9

def hash_value
  @hash_value
end

#nameString

Returns Name of protected range.

Returns:

  • (String)

    Name of protected range



15
16
17
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/protected_range.rb', line 15

def name
  @name
end

#reference_sequenceString (readonly)

Returns Range reference.

Returns:

  • (String)

    Range reference



17
18
19
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/protected_range.rb', line 17

def reference_sequence
  @reference_sequence
end

#salt_valueString (readonly)

Returns Salt value for the password.

Returns:

  • (String)

    Salt value for the password



11
12
13
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/protected_range.rb', line 11

def salt_value
  @salt_value
end

#spin_countInteger (readonly)

Returns Number of times the hashing function shall be iteratively run.

Returns:

  • (Integer)

    Number of times the hashing function shall be iteratively run



13
14
15
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/protected_range.rb', line 13

def spin_count
  @spin_count
end

Instance Method Details

#parse(node) ⇒ Sheet

Parse ProtectedRange data

Parameters:

  • node (Nokogiri::XML:Element)

    with ProtectedRange data

Returns:

  • (Sheet)

    value of ProtectedRange



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/protected_range.rb', line 22

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'algorithmName'
      @algorithm_name = value.value.to_s
    when 'hashValue'
      @hash_value = value.value.to_s
    when 'saltValue'
      @salt_value = value.value.to_s
    when 'spinCount'
      @spin_count = value.value.to_i
    when 'name'
      @name = value.value.to_s
    when 'sqref'
      @reference_sequence = value.value.to_s
    end
  end
  self
end