class Xlsxrb::Ooxml::Reader::SheetProtectionListener
SAX2 listener for parsing <sheetProtection> element.
Constants
- ATTR_MAP
- BOOL_ATTRS
- FALSE_ATTRS
Attributes
protection
[R]
untyped
Public Class Methods
() → untyped
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 482 def initialize @protection = nil end
Public Instance Methods
(untyped _uri, untyped local_name, untyped qname, untyped attributes) → untyped
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 502 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