class Xlsxrb::Ooxml::Reader::SheetProtectionListener
SAX2 listener for parsing <sheetProtection> element.
Constants
- ATTR_MAP
- BOOL_ATTRS
- FALSE_ATTRS
Attributes
Public Class Methods
Public Instance Methods
# File lib/xlsxrb/ooxml/reader.rb, line 3262 def start_element(_uri, local_name, qname, attributes) name = element_name(local_name, qname) return unless name == "sheetProtection" prot = {} ATTR_MAP.each do |xml_attr, sym| val = attributes[xml_attr] next if val.nil? prot[sym] = if sym == :spin_count val.to_i elsif %i[password algorithm_name hash_value salt_value].include?(sym) val else %w[1 true].include?(val) end end @protection = prot unless prot.empty? end