Module: TwitterFriendly::REST::Favorites

Included in:
API
Defined in:
lib/twitter_friendly/rest/favorites.rb

Constant Summary collapse

MAX_TWEETS_PER_REQUEST =
100

Instance Method Summary collapse

Instance Method Details

#favorites(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/twitter_friendly/rest/favorites.rb', line 7

def favorites(*args)
  options = {count: MAX_TWEETS_PER_REQUEST}.merge(args.extract_options!)
  args << options

  if options[:count] <= MAX_TWEETS_PER_REQUEST
    @twitter.favorites(*args)&.map(&:attrs)
  else
    fetch_tweets_with_max_id(__method__, MAX_TWEETS_PER_REQUEST, *args)
  end
end