lib/twitter/rest/api/saved_searches.rb in twitter-5.3.0 vs lib/twitter/rest/api/saved_searches.rb in twitter-5.3.1
- old
+ new
@@ -1,8 +1,9 @@
require 'twitter/arguments'
require 'twitter/rest/api/utils'
require 'twitter/saved_search'
+require 'twitter/utils'
module Twitter
module REST
module API
module SavedSearches
@@ -31,11 +32,11 @@
def saved_searches(*args)
arguments = Twitter::Arguments.new(args)
if arguments.empty?
objects_from_response(Twitter::SavedSearch, :get, '/1.1/saved_searches/list.json', arguments.options)
else
- arguments.flatten.threaded_map do |id|
+ Twitter::Utils.parallel_map(arguments) do |id|
saved_search(id, arguments.options)
end
end
end
@@ -79,10 +80,10 @@
# @overload destroy_saved_search(*ids, options)
# @param ids [Enumerable<Integer>] A collection of saved search IDs.
# @param options [Hash] A customizable set of options.
def destroy_saved_search(*args)
arguments = Twitter::Arguments.new(args)
- arguments.flatten.threaded_map do |id|
+ Twitter::Utils.parallel_map(arguments) do |id|
object_from_response(Twitter::SavedSearch, :post, "/1.1/saved_searches/destroy/#{id}.json", arguments.options)
end
end
deprecate_alias :saved_search_destroy, :destroy_saved_search
end