class Saxlsx::RowsCollectionCountParser
Attributes
count[R]
Public Class Methods
count(data, &block)
click to toggle source
# File lib/saxlsx/rows_collection_count_parser.rb, line 4 def self.count(data, &block) parser = new catch :abort do SaxParser.parse parser, data end parser.count end
new()
click to toggle source
# File lib/saxlsx/rows_collection_count_parser.rb, line 14 def initialize @count = 0 end
Public Instance Methods
attr(name, value)
click to toggle source
# File lib/saxlsx/rows_collection_count_parser.rb, line 25 def attr(name, value) if @current_element == :dimension if name == :ref && value matches = value.match(/[^:]+:[A-Z]*(\d+)/) if matches @count = matches[1].to_i throw :abort end end end end
start_element(name)
click to toggle source
# File lib/saxlsx/rows_collection_count_parser.rb, line 18 def start_element(name) @current_element = name if name == :row @count += 1 end end