Class: Saxlsx::RowsCollectionCountParser
- Inherits:
-
Ox::Sax
- Object
- Ox::Sax
- Saxlsx::RowsCollectionCountParser
- Defined in:
- lib/saxlsx/rows_collection_count_parser.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Class Method Summary collapse
Instance Method Summary collapse
- #attr(name, value) ⇒ Object
-
#initialize ⇒ RowsCollectionCountParser
constructor
A new instance of RowsCollectionCountParser.
- #start_element(name) ⇒ Object
Constructor Details
#initialize ⇒ RowsCollectionCountParser
Returns a new instance of RowsCollectionCountParser.
14 15 16 |
# File 'lib/saxlsx/rows_collection_count_parser.rb', line 14 def initialize @count = 0 end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
12 13 14 |
# File 'lib/saxlsx/rows_collection_count_parser.rb', line 12 def count @count end |
Class Method Details
Instance Method Details
#attr(name, value) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# 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) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/saxlsx/rows_collection_count_parser.rb', line 18 def start_element(name) @current_element = name if name == :row @count += 1 end end |