From 07711210d0ef2ef45b4957579cf2f1ead6bfc4d8 Mon Sep 17 00:00:00 2001 From: Robbie Clutton Date: Wed, 4 Jul 2012 10:47:07 -0400 Subject: [PATCH] 'll' not required is 'near' is sent, and vice versa When searching for venues, you can specify 'near' with a value like 'New York, NY' instead of specifiying a lat/long value --- lib/foursquare/venue_proxy.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/foursquare/venue_proxy.rb b/lib/foursquare/venue_proxy.rb index 5f49c3a..729e4a1 100644 --- a/lib/foursquare/venue_proxy.rb +++ b/lib/foursquare/venue_proxy.rb @@ -9,7 +9,7 @@ def find(id) end def search(options={}) - raise ArgumentError, "You must include :ll" unless options[:ll] + raise ArgumentError, "You must include :ll or :near" unless (options[:ll] || options[:near]) response = @foursquare.get('venues/search', options)["groups"].inject({}) do |venues, group| venues[group["type"]] ||= [] venues[group["type"]] += group["items"].map do |json| @@ -34,7 +34,7 @@ def nearby(options={}) private def search_group(name, options) - raise ArgumentError, "You must include :ll" unless options[:ll] + raise ArgumentError, "You must include :ll or :near" unless (options[:ll] || options[:near]) response = @foursquare.get('venues/search', options)["groups"].detect { |group| group["type"] == name } response ? response["items"].map do |json| Foursquare::Venue.new(@foursquare, json)