Parent

Methods

Class/Module Index [+]

Quicksearch

Twitter::Streaming::MessageParser

Public Class Methods

parse(data) click to toggle source
# File lib/twitter/streaming/message_parser.rb, line 11
def self.parse(data) # rubocop:disable CyclomaticComplexity
  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])
  elsif data[:delete] && data[:delete][:status]
    DeletedTweet.new(data[:delete][:status])
  elsif data[:warning]
    StallWarning.new(data[:warning])
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.