Class: OverpassAPI::Base
- Inherits:
-
Object
- Object
- OverpassAPI::Base
- Defined in:
- lib/base.rb
Constant Summary collapse
- DEFAULT_ENDPOINT =
'http://overpass-api.de/api/interpreter'
Instance Method Summary collapse
- #bounding_box(s, n, w, e) ⇒ Object
-
#initialize(args = {}) ⇒ Base
constructor
A new instance of Base.
- #query(q) ⇒ Object
- #raw_query(q) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 |
# File 'lib/base.rb', line 8 def initialize(args={}) bbox = args[:bbox] bounding_box(bbox[:s],bbox[:n],bbox[:w],bbox[:e]) if bbox @endpoint = args[:endpoint] || DEFAULT_ENDPOINT @timeout = args[:timeout] end |
Instance Method Details
#bounding_box(s, n, w, e) ⇒ Object
16 17 18 |
# File 'lib/base.rb', line 16 def bounding_box(s,n,w,e) @bbox = "#{s},#{w},#{n},#{e}" end |
#query(q) ⇒ Object
20 21 22 |
# File 'lib/base.rb', line 20 def query(q) perform build_query(q) end |
#raw_query(q) ⇒ Object
24 25 26 |
# File 'lib/base.rb', line 24 def raw_query(q) perform q end |