Skip to content

Commit

Permalink
Started handling delete
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-vautour authored and sferik committed Nov 28, 2013
1 parent 64dc08f commit 8860b97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/twitter/streaming/message_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def self.parse(data)
DirectMessage.new(data[:direct_message])
elsif data[:friends]
FriendList.new(data[:friends])
elsif data[:delete]
if data[:delete][:status]
Tweet.new(data[:delete][:status].merge(:deleted => true))
end
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions lib/twitter/tweet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Tweet < Twitter::Identity
alias favoriters_count favorite_count
alias in_reply_to_tweet_id in_reply_to_status_id
alias retweeters_count retweet_count
attr_reader :deleted
object_attr_reader :GeoFactory, :geo
object_attr_reader :Metadata, :metadata
object_attr_reader :Place, :place
Expand All @@ -30,6 +31,12 @@ def filter_level
@attrs[:filter_level] || "none"
end
memoize :filter_level

# @note Not a real entity
# @return [Boolean]
def deleted?
deleted == true
end

# @return [String]
# @note May be > 140 characters.
Expand Down

0 comments on commit 8860b97

Please sign in to comment.