Skip to content

Commit

Permalink
Added date_ranges to location
Browse files Browse the repository at this point in the history
  • Loading branch information
kfrye committed Dec 2, 2015
1 parent f44be54 commit 7801bc4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/location.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,19 @@ for more information.
.. note::

``polygon_id`` needs to be a string. ``Zoom`` is a number ranging from 1-20.


Location Date Ranges
--------------------

Get the possible date ranges that can be used with location endpoints. See `the documentation
on location date ranges <http://docs.urbanairship.com/api/ua.html#location-date-ranges>`__
for more information.

.. code-block:: ruby
require 'urbanairship'
UA = Urbanairship
airship = UA::Client.new(key:'application_key', secret:'master_secret')
l = UA::Location.new(client: airship)
l.date_ranges
9 changes: 9 additions & 0 deletions lib/urbanairship/push/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ def polygon_lookup(polygon_id: required('polygon_id'), zoom: required('zoom'))
logger.info("Retrieved location info for polygon #{polygon_id} and zoom level #{zoom}")
resp
end

def date_ranges
resp = @client.send_request(
method: 'GET',
url: SEGMENTS_URL + 'dates/'
)
logger.info('Retrieved location date ranges')
resp
end
end
end
end

0 comments on commit 7801bc4

Please sign in to comment.