Module: Ohanakapa::Client::Locations
- Included in:
- Ohanakapa::Client
- Defined in:
- lib/ohanakapa/client/locations.rb
Overview
Methods for the Locations API
Instance Method Summary collapse
-
#location(id) ⇒ Sawyer::Resource
(also: #loc)
Get a single location based on its ID.
-
#locations(options = {}) ⇒ Array<Sawyer::Resource>
(also: #locs)
List all locations.
-
#nearby(id, options = {}) ⇒ Sawyer::Resource
Get nearby locations to an location, based on its ID.
-
#update_location(id, options) ⇒ Sawyer::Resource
Update a location.
Instance Method Details
#location(id) ⇒ Sawyer::Resource Also known as: loc
Get a single location based on its ID
36 37 38 |
# File 'lib/ohanakapa/client/locations.rb', line 36 def location(id) get("locations/#{id}") end |
#locations(options = {}) ⇒ Array<Sawyer::Resource> Also known as: locs
List all locations
This provides a dump of every location, in the order that they were uploaded to the Ohana DB.
22 23 24 |
# File 'lib/ohanakapa/client/locations.rb', line 22 def locations(={}) paginate "locations", end |
#nearby(id, options = {}) ⇒ Sawyer::Resource
Get nearby locations to an location, based on its ID
49 50 51 |
# File 'lib/ohanakapa/client/locations.rb', line 49 def nearby(id, ={}) get("locations/#{id}/nearby", ) end |
#update_location(id, options) ⇒ Sawyer::Resource
Update a location
61 62 63 |
# File 'lib/ohanakapa/client/locations.rb', line 61 def update_location(id, ) put "locations/#{id}", :query => end |