Class: Devinci::Bixi
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#downloaded_on, #initialize, #io
Constructor Details
This class inherits a constructor from Devinci::Base
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
3 4 5 |
# File 'lib/devinci/bixi.rb', line 3 def document @document end |
Instance Method Details
#parse ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/devinci/bixi.rb', line 5 def parse @document = Nokogiri::XML(io) @document.xpath('/stations/station').map do |node| parse_station(node) end rescue Exception => e raise Devinci::ParseError, "Error parsing the input from XML: #{e.}", e.backtrace ensure io.close end |