Permalink
Browse files

fixed the since argument in Base#direct_message method (jnewland)

git-svn-id: http://svn.addictedtonew.com/public/gems/twitter@71 fe7eae16-9a24-0410-a59d-9e59979e88be
  • Loading branch information...
1 parent 69a78d9 commit 41a9006be9221d7305752639ac4440b3a8859cd0 jnunemaker committed Jun 22, 2007
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/twitter/base.rb
View
@@ -59,7 +59,9 @@ def followers
#
# <tt>since</tt> - (optional) Narrows the resulting list of direct messages to just those sent after the specified HTTP-formatted date.
def direct_messages(since=nil)
- doc = request('direct_messages.xml', { :auth => true })
+ path = 'direct_messages.xml'
+ since.nil? ? 1 : path << "?since=#{CGI.escape(since.to_s)}"
+ doc = request(path, { :auth => true })
(doc/:direct_message).inject([]) { |dms, dm| dms << DirectMessage.new_from_xml(dm); dms }
end

0 comments on commit 41a9006

Please sign in to comment.