Module: Instagram::Client::Locations
- Included in:
- Instagram::Client
- Defined in:
- lib/instagram/client/locations.rb
Overview
Defines methods related to media items
Instance Method Summary collapse
-
#location(id) ⇒ Hashie::Mash
Returns extended information of a given Instagram location.
-
#location_recent_media(id, options = {}) ⇒ Hashie::Mash
Returns a list of recent media items for a given Instagram location.
-
#location_search(options = {}) ⇒ Hashie::Mash
Returns Instagram locations within proximity of given lat,lng or Facebook Places ID.
Instance Method Details
#location(id) ⇒ Hashie::Mash
Returns extended information of a given Instagram location
16 17 18 19 |
# File 'lib/instagram/client/locations.rb', line 16 def location(id, *_args) response = get("locations/#{id}") response end |
#location_recent_media(id, options = {}) ⇒ Hashie::Mash
Returns a list of recent media items for a given Instagram location
36 37 38 39 40 |
# File 'lib/instagram/client/locations.rb', line 36 def location_recent_media(id, *args) = args.last.is_a?(Hash) ? args.pop : {} response = get("locations/#{id}/media/recent", ) response end |
#location_search(options = {}) ⇒ Hashie::Mash
Returns Instagram locations within proximity of given lat,lng or Facebook Places ID
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/instagram/client/locations.rb', line 58 def location_search(*args) = args.last.is_a?(Hash) ? args.pop : {} case args.size when 1 facebook_places_id = args.first response = get("locations/search", .merge(facebook_places_id: facebook_places_id)) when 2 lat, lng = args response = get("locations/search", .merge(lat: lat, lng: lng)) when 3 lat, lng, distance = args response = get("locations/search", .merge(lat: lat, lng: lng, distance: distance)) end response end |