Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix inconsistent Hash.new behavior in Ruby 1.8

  • Loading branch information...
commit 70d94f5568591762ccff938338cc3c322c1ed87b 1 parent 7674681
@sferik authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/twitter/client/trends.rb
View
3  lib/twitter/client/trends.rb
@@ -19,7 +19,8 @@ module Trends
# @example Return the top 20 trending topics for each hour of October 24, 2010
# Twitter.trends_daily(Date.parse("2010-10-24"))
def trends_daily(date=Date.today, options={})
- get("/1/trends/daily.json", options.merge(:date => date.strftime('%Y-%m-%d')))['trends'].each_with_object(Hash.new([])) do |(key, value), object|
+ get("/1/trends/daily.json", options.merge(:date => date.strftime('%Y-%m-%d')))['trends'].each_with_object({}) do |(key, value), object|
+ object[key] = []
value.each do |trend|
object[key] << Twitter::Trend.new(trend)
end
Please sign in to comment.
Something went wrong with that request. Please try again.