Class: RETS4R::Client::CompactNokogiriParser
- Inherits:
-
Object
- Object
- RETS4R::Client::CompactNokogiriParser
- Includes:
- Enumerable
- Defined in:
- lib/rets4r/client/parsers/compact_nokogiri.rb
Defined Under Namespace
Classes: CompactDocument
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(io) ⇒ CompactNokogiriParser
constructor
A new instance of CompactNokogiriParser.
- #to_a ⇒ Object
Constructor Details
#initialize(io) ⇒ CompactNokogiriParser
Returns a new instance of CompactNokogiriParser.
6 7 8 9 10 |
# File 'lib/rets4r/client/parsers/compact_nokogiri.rb', line 6 def initialize(io) @doc = CompactDocument.new @parser = Nokogiri::XML::SAX::Parser.new(@doc) @io = io end |
Instance Method Details
#each(&block) ⇒ Object
17 18 19 20 21 |
# File 'lib/rets4r/client/parsers/compact_nokogiri.rb', line 17 def each(&block) @doc.proc = block.to_proc @parser.parse(@io) nil end |
#to_a ⇒ Object
12 13 14 15 |
# File 'lib/rets4r/client/parsers/compact_nokogiri.rb', line 12 def to_a @parser.parse(@io) if @doc.results.empty? @doc.results end |