lib/twitter/api/timelines.rb in twitter_anonymous_client-0.0.1 vs lib/twitter/api/timelines.rb in twitter_anonymous_client-1.0.0.0

- old
+ new

@@ -1,18 +1,22 @@ require 'twitter/default' require 'twitter/tweet' module Twitter module API - # @note Inspired from gems\twitter-4.5.0\spec\twitter\api\timelines_spec.rb + # @note Inspired from twitter-4.5.0/spec/twitter/api/timelines_spec.rb module Timelines - # Get some user timeline by screen name + # Get some user timeline by screen name (last statuses) # - # @example - # user_timeline('DolarBlue', count: 1) + # @param [String] screen_name the twitter user slug + # @param [Hash] opts the options to retrieve the statuses + # @option opts [Integer] :count The number of statuses to retrieve # + # @example + # Twitter::Client.new.user_timeline('DolarBlue', count: 1) + # #=> [#<Twitter::Tweet:0x011.. @id="308609..., @text="Dolar Paralelo: $7,84..... def user_timeline(screen_name, opts) # Sanitize arguments count = opts[:count] || 1 screen_name = screen_name.to_s # Work out @@ -20,9 +24,11 @@ Twitter::Tweet.build_tweets(results) end private + # (see #user_timeline) + # @private def get_user_timeline_results(screen_name, count) path = "statuses/user_timeline.json" qry = [] qry << ['screen_name', screen_name] qry << ['count', count.to_s]