Class: OverpassAPI::XML
Overview
builds queries in xml format
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
- #build_query(query) ⇒ Object
-
#initialize(args = {}) ⇒ XML
constructor
A new instance of XML.
Methods inherited from Base
#bounding_box, #query, #raw_query
Constructor Details
#initialize(args = {}) ⇒ XML
Returns a new instance of XML.
6 7 8 9 |
# File 'lib/xml.rb', line 6 def initialize(args = {}) super @element_limit = args[:element_limit] end |
Instance Method Details
#build_query(query) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/xml.rb', line 11 def build_query(query) bbox = @bbox ? " bbox='#{@bbox}'" : '' timeout = @timeout ? " timeout='#{@timeout}'" : '' element_limit = @element_limit ? " element-limit='#{@element_limit}'" : '' "<osm-script#{bbox}#{timeout}#{element_limit} output='json'>" \ "#{query}<print/></osm-script>" end |