Skip to content

Commit

Permalink
create Util module with threaded_map method
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Somerville committed Dec 18, 2013
1 parent 72e0b56 commit a1f47fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@
require 'twitter/trend'
require 'twitter/tweet'
require 'twitter/user'
require 'twitter/util'
9 changes: 9 additions & 0 deletions lib/twitter/util.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Twitter
module Util
def self.threaded_map(enumerable)
enumerable.map { |object|
Thread.new { yield object }
}.map(&:value)
end
end
end

0 comments on commit a1f47fb

Please sign in to comment.