class Xlsxrb::Ooxml::Reader::ProtectedRangesListener
SAX2 listener for parsing <protectedRanges> element.
Attributes
ranges
[R]
untyped
Public Class Methods
() → untyped
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 539 def initialize @ranges = [] @current = nil end
Public Instance Methods
(untyped text) → untyped
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 562 def characters(text) @sd_text << text if @in_sd end
(untyped _uri, untyped local_name, untyped qname) → untyped
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 566 def end_element(_uri, local_name, qname) name = element_name(local_name, qname) case name when "securityDescriptor" (@current[:security_descriptors] ||= []) << @sd_text if @current @in_sd = false when "protectedRange" @ranges << @current if @current @current = nil end end
(untyped _uri, untyped local_name, untyped qname, untyped attributes) → untyped
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 544 def start_element(_uri, local_name, qname, attributes) name = element_name(local_name, qname) case name when "protectedRange" pr = {} pr[:sqref] = attributes["sqref"] if attributes["sqref"] pr[:name] = attributes["name"] if attributes["name"] pr[:algorithm_name] = attributes["algorithmName"] if attributes["algorithmName"] pr[:hash_value] = attributes["hashValue"] if attributes["hashValue"] pr[:salt_value] = attributes["saltValue"] if attributes["saltValue"] pr[:spin_count] = attributes["spinCount"].to_i if attributes["spinCount"] @current = pr when "securityDescriptor" @in_sd = true @sd_text = +"" end end