lib/tw/client/tweet.rb in tw-0.4.7 vs lib/tw/client/tweet.rb in tw-0.4.8
- old
+ new
@@ -1,21 +1,25 @@
module Tw
class Tweet
- attr_reader :id, :user, :text, :time
+ attr_reader :id, :user, :text, :time, :fav_count, :rt_count
def initialize(opts)
@id = opts[:id]
@user = opts[:user]
@text = opts[:text]
@time = opts[:time]
+ @fav_count = opts[:fav_count]
+ @rt_count = opts[:rt_count]
end
def to_json(*a)
{
:id => @id,
:user => @user,
:text => @text,
- :time => @time
+ :time => @time,
+ :fav_count => @fav_count,
+ :rt_count => @rt_count
}.to_json(*a)
end
def url
"http://twitter.com/#{user}/status/#{id}"