Class: Twitter::Streaming::MessageParser

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter/streaming/message_parser.rb

Class Method Summary collapse

Class Method Details

.parse(data) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/twitter/streaming/message_parser.rb', line 5

def self.parse(data)
  if data[:id]
    Tweet.new(data)
  elsif data[:event]
    Event.new(data)
  elsif data[:direct_message]
    DirectMessage.new(data[:direct_message])
  elsif data[:friends]
    FriendList.new(data[:friends])
  end
end