lib/pupil/statuses.rb in pupil-0.1.3 vs lib/pupil/statuses.rb in pupil-0.1.4

- old
+ new

@@ -7,34 +7,34 @@ # @option param [Fixnum] :page # @option param [Symbol] :trim_user # @option param [Symbol] :include #=> [:rts] # @option param [Symbol] :exclude #=> [:replies] # @option param [Symbol] :contributor_details - def home_timeline param={} + def home_timeline(param={}) response = self.get("/statuses/home_timeline.json", param) statuses = Array.new response.each do |element| status = Status.new element statuses << status end return statuses end - # @return [Hash] mention + # @return [Array] Mention # @param [Hash] param - def mentions param={} + def mentions(param={}) response = self.get("/statuses/mentions.json", param) statuses = Array.new response.each do |element| status = Status.new element statuses << status end return statuses end # Returning user timeline - # @return [Hash] timeline + # @return [Array] timeline # @param [Hash] param # @option param [Fixnum] :user_id The ID of user # @option param [String] :screen_name The Screen name of user # @option param [Fixnum] :since_id # @option param [Fixnum] :max_id @@ -47,20 +47,32 @@ # @example # twitter = Pupil.new PUPIL_KEY # twitter.user_timeline(:screen_name => 'o_ame', :exclude => :replies).each do |status| # puts "#{status.user.screen_name}: #{status.text}" # end - def user_timeline param={} + def user_timeline(param={}) response = self.get("/statuses/user_timeline.json", param) statuses = Array.new response.each do |element| status = Status.new element statuses << status end return statuses end + # Returning public timeline + # @return [Array] Timeline + # @param [Hash] param + def public_timeline(param={}) + response = self.get("/statuses/public_timeline.json", param) + statuses = Array.new + response.each do |element| + status = Status.new element + statuses << status + end + return statuses + end - def show_status status_id + def show_status(status_id) response = @access_token.get("/statuses/show/#{status_id}.json").body return response status = Status.new response return status end \ No newline at end of file