class TweetFinder
Public Class Methods
new(client, topics)
click to toggle source
# File lib/finders/tweet_finder.rb, line 2 def initialize(client, topics) @client = client @topics = topics end
Public Instance Methods
find_tweet(query)
click to toggle source
# File lib/finders/tweet_finder.rb, line 13 def find_tweet(query) @client.search(query) end
find_tweets()
click to toggle source
# File lib/finders/tweet_finder.rb, line 7 def find_tweets @topics.reduce([]) do |t, topic| t << Thread.new(topic) { |topic| find_tweet(topic) } end.each { |t| t.join }.map { |t| t.value } end