Class: AllTweets::Fetcher
- Inherits:
-
Object
- Object
- AllTweets::Fetcher
- Defined in:
- lib/alltweets/fetcher.rb
Instance Method Summary collapse
- #fetch_all_tweets(user, include_retweets: true) ⇒ Object
-
#initialize(arg) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(arg) ⇒ Fetcher
Returns a new instance of Fetcher.
5 6 7 8 9 10 11 12 |
# File 'lib/alltweets/fetcher.rb', line 5 def initialize(arg) @client = case arg when Hash Twitter::REST::Client.new(arg) else arg end end |
Instance Method Details
#fetch_all_tweets(user, include_retweets: true) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/alltweets/fetcher.rb', line 14 def fetch_all_tweets(user, include_retweets: true) collect_with_max_id do |max_id| = {count: 200, include_rts: include_retweets} [:max_id] = max_id unless max_id.nil? @client.user_timeline(user, ) end end |