Class: Saxlsx::SharedStringCollectionParser
- Inherits:
-
Ox::Sax
- Object
- Ox::Sax
- Saxlsx::SharedStringCollectionParser
- Defined in:
- lib/saxlsx/shared_string_collection_parser.rb
Class Method Summary collapse
Instance Method Summary collapse
- #end_element(name) ⇒ Object
-
#initialize(&block) ⇒ SharedStringCollectionParser
constructor
A new instance of SharedStringCollectionParser.
- #start_element(name) ⇒ Object
- #text(value) ⇒ Object
Constructor Details
#initialize(&block) ⇒ SharedStringCollectionParser
Returns a new instance of SharedStringCollectionParser.
14 15 16 |
# File 'lib/saxlsx/shared_string_collection_parser.rb', line 14 def initialize(&block) @block = block end |
Class Method Details
Instance Method Details
#end_element(name) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/saxlsx/shared_string_collection_parser.rb', line 22 def end_element(name) if name == :si @block.call @current_string @current_string = nil end end |
#start_element(name) ⇒ Object
18 19 20 |
# File 'lib/saxlsx/shared_string_collection_parser.rb', line 18 def start_element(name) @current_string = String.new if name == :si end |
#text(value) ⇒ Object
29 30 31 |
# File 'lib/saxlsx/shared_string_collection_parser.rb', line 29 def text(value) @current_string << CGI.unescapeHTML(value) if @current_string end |