Class: Innards::Parsers::SearchParser
- Inherits:
-
ParserBase
- Object
- Ox::Sax
- ParserBase
- Innards::Parsers::SearchParser
- Defined in:
- lib/innards/parsers/search_parser.rb
Overview
SAX Parser for RETS Search Response
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Attributes inherited from ParserBase
Instance Method Summary collapse
- #attr(name, value) ⇒ Object
- #end_element(name) ⇒ Object
-
#initialize ⇒ SearchParser
constructor
A new instance of SearchParser.
- #start_element(name) ⇒ Object
- #text(value) ⇒ Object
Methods inherited from ParserBase
#data_merger, #data_splitter, #element_tracker_switch, #response_code, #split_multiline_key_value_pairs, #switch_active?, #valid_rets_response_received?
Constructor Details
#initialize ⇒ SearchParser
Returns a new instance of SearchParser.
10 11 12 13 |
# File 'lib/innards/parsers/search_parser.rb', line 10 def initialize super @results = [] end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
8 9 10 |
# File 'lib/innards/parsers/search_parser.rb', line 8 def columns @columns end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
8 9 10 |
# File 'lib/innards/parsers/search_parser.rb', line 8 def results @results end |
Instance Method Details
#attr(name, value) ⇒ Object
23 24 25 |
# File 'lib/innards/parsers/search_parser.rb', line 23 def attr(name, value) super end |
#end_element(name) ⇒ Object
19 20 21 |
# File 'lib/innards/parsers/search_parser.rb', line 19 def end_element(name) super end |
#start_element(name) ⇒ Object
15 16 17 |
# File 'lib/innards/parsers/search_parser.rb', line 15 def start_element(name) super end |
#text(value) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/innards/parsers/search_parser.rb', line 27 def text(value) super if switch_active?(:COLUMNS) @columns = data_splitter(value) end if switch_active?(:DATA) @results.push data_merger(@columns, data_splitter(value)) end end |