Skip to content

Commit

Permalink
Add Activity#about_me and Activity#by_friends methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Sep 5, 2011
1 parent 327724b commit 35e9610
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/twitter/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ class Client < API
# order to avoid a superclass mismatch error, allowing those modules to be
# Client-namespaced.
require 'twitter/client/account'
require 'twitter/client/activity'
require 'twitter/client/block'
require 'twitter/client/direct_messages'
require 'twitter/client/favorites'
require 'twitter/client/friendship'
require 'twitter/client/friends_and_followers'
require 'twitter/client/friendship'
require 'twitter/client/geo'
require 'twitter/client/help'
require 'twitter/client/legal'
Expand All @@ -36,11 +37,12 @@ class Client < API
include Twitter::Client::Utils

include Twitter::Client::Account
include Twitter::Client::Activity
include Twitter::Client::Block
include Twitter::Client::DirectMessages
include Twitter::Client::Favorites
include Twitter::Client::Friendship
include Twitter::Client::FriendsAndFollowers
include Twitter::Client::Friendship
include Twitter::Client::Geo
include Twitter::Client::Help
include Twitter::Client::Legal
Expand Down
40 changes: 40 additions & 0 deletions lib/twitter/client/activity.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module Twitter
class Client
# Defines methods related to URLs
module Activity
# Returns activity about me
#
# @note Undocumented
# @rate_limited Yes
# @requires_authentication Yes
# @response_format `json`
# @param options [Hash] A customizable set of options.
# @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100.
# @option options [Boolean, String, Integer] :include_entities Include {http://dev.twitter.com/pages/tweet_entities Tweet Entities} when set to true, 't' or 1.
# @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID.
# @return [Array] An array of actions
# @example Return activity about me
# Twitter.about_me
def about_me(options={})
get("i/activity/about_me", options, :json)
end

# Returns activity by friends
#
# @note Undocumented
# @rate_limited Yes
# @requires_authentication Yes
# @response_format `json`
# @param options [Hash] A customizable set of options.
# @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100.
# @option options [Boolean, String, Integer] :include_entities Include {http://dev.twitter.com/pages/tweet_entities Tweet Entities} when set to true, 't' or 1.
# @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID.
# @return [Array] An array of actions
# @example Return activity by friends
# Twitter.by_friends
def by_friends(options={})
get("i/activity/by_friends", options, :json)
end
end
end
end

0 comments on commit 35e9610

Please sign in to comment.