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)