Module: Twitter::Utils Private
- Included in:
- Base, Client, Cursor, Error, GeoResults, PremiumSearchResults, REST::AccountActivity, REST::DirectMessages, REST::DirectMessages::WelcomeMessages, REST::Favorites, REST::FriendsAndFollowers, REST::Lists, REST::Request, REST::SavedSearches, REST::Tweets, REST::Users, REST::Utils, SearchResults, Streaming::Client, TrendResults
- Defined in:
- lib/twitter/utils.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Utility methods for parallel mapping
Class Method Summary collapse
-
.flat_pmap(enumerable, &block) ⇒ Array, Enumerator
private
Parallel flat_map for enumerables.
-
.pmap(enumerable) ⇒ Array, Enumerator
private
Parallel map for enumerables.
Class Method Details
.flat_pmap(enumerable, &block) ⇒ Array, Enumerator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parallel flat_map for enumerables
11 12 13 14 15 |
# File 'lib/twitter/utils.rb', line 11 def flat_pmap(enumerable, &block) return to_enum(:flat_pmap, enumerable) unless block pmap(enumerable, &block).flatten(1) end |
.pmap(enumerable) ⇒ Array, Enumerator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parallel map for enumerables
23 24 25 26 27 |
# File 'lib/twitter/utils.rb', line 23 def pmap(enumerable, &) return to_enum(:pmap, enumerable) unless block_given? enumerable.collect(&) end |