lib/twitter/rest/places_and_geo.rb in twitter-5.12.0 vs lib/twitter/rest/places_and_geo.rb in twitter-5.13.0
- old
+ new
@@ -1,8 +1,7 @@
require 'twitter/geo_results'
require 'twitter/place'
-require 'twitter/request'
require 'twitter/rest/utils'
module Twitter
module REST
module PlacesAndGeo
@@ -16,11 +15,11 @@
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @param place_id [String] A place in the world. These IDs can be retrieved from {Twitter::REST::PlacesAndGeo#reverse_geocode}.
# @param options [Hash] A customizable set of options.
# @return [Twitter::Place] The requested place.
def place(place_id, options = {})
- perform_with_object(:get, "/1.1/geo/id/#{place_id}.json", options, Twitter::Place)
+ perform_get_with_object("/1.1/geo/id/#{place_id}.json", options, Twitter::Place)
end
# Searches for up to 20 places that can be used as a place_id
#
# @see https://dev.twitter.com/docs/api/1.1/get/geo/reverse_geocode
@@ -34,11 +33,11 @@
# @option options [String] :accuracy ('0m') A hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet. If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.).
# @option options [String] :granularity ('neighborhood') This is the minimal granularity of place types to return and must be one of: 'poi', 'neighborhood', 'city', 'admin' or 'country'.
# @option options [Integer] :max_results A hint as to the number of results to return. This does not guarantee that the number of results returned will equal max_results, but instead informs how many "nearby" results to return. Ideally, only pass in the number of places you intend to display to the user here.
# @return [Array<Twitter::Place>]
def reverse_geocode(options = {})
- perform_with_object(:get, '/1.1/geo/reverse_geocode.json', options, Twitter::GeoResults)
+ perform_get_with_object('/1.1/geo/reverse_geocode.json', options, Twitter::GeoResults)
end
# Search for places that can be attached to a {Twitter::REST::Tweets#update}
#
# @see https://dev.twitter.com/docs/api/1.1/get/geo/search
@@ -55,11 +54,11 @@
# @option options [Integer] :max_results A hint as to the number of results to return. This does not guarantee that the number of results returned will equal max_results, but instead informs how many "nearby" results to return. Ideally, only pass in the number of places you intend to display to the user here.
# @option options [String] :contained_within This is the place_id which you would like to restrict the search results to. Setting this value means only places within the given place_id will be found.
# @option options [String] :"attribute:street_address" This option searches for places which have this given street address. There are other well-known and application-specific attributes available. Custom attributes are also permitted.
# @return [Array<Twitter::Place>]
def geo_search(options = {})
- perform_with_object(:get, '/1.1/geo/search.json', options, Twitter::GeoResults)
+ perform_get_with_object('/1.1/geo/search.json', options, Twitter::GeoResults)
end
alias_method :places_nearby, :geo_search
# Locates places near the given coordinates which are similar in name
#
@@ -74,10 +73,10 @@
# @option options [String] :name The name a place is known as.
# @option options [String] :contained_within This is the place_id which you would like to restrict the search results to. Setting this value means only places within the given place_id will be found.
# @option options [String] :"attribute:street_address" This option searches for places which have this given street address. There are other well-known and application-specific attributes available. Custom attributes are also permitted.
# @return [Array<Twitter::Place>]
def similar_places(options = {})
- perform_with_object(:get, '/1.1/geo/similar_places.json', options, Twitter::GeoResults)
+ perform_get_with_object('/1.1/geo/similar_places.json', options, Twitter::GeoResults)
end
alias_method :places_similar, :similar_places
end
end
end