Skip to content

Commit

Permalink
Update #messages to support all the parameters offered by the API, no…
Browse files Browse the repository at this point in the history
…t just page.
  • Loading branch information
Brad Greenlee authored and moomerman committed Apr 27, 2010
1 parent aff1dd6 commit 81e8bf7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/twitter_oauth/direct_messages.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
module TwitterOAuth
class Client

# Returns a list of the 20 most recent direct messages sent to the authenticating user.
def messages(page=1)
get("/direct_messages.json?page=#{page}")
# Return the most recent direct messages sent to the authenticating user.
# By default, returns the last 20. See http://apiwiki.twitter.com/Twitter-REST-API-Method:-direct_messages
# for other options
def messages(options={})
args = options.map{|k,v| "#{k}=#{v}"}.join('&')
get("/direct_messages.json?#{args}")
end

# Returns a list of the 20 most recent direct messages sent by the authenticating user.
Expand Down

0 comments on commit 81e8bf7

Please sign in to comment.