Class: Mastodon::Streaming::MessageParser
- Inherits:
-
Object
- Object
- Mastodon::Streaming::MessageParser
- Defined in:
- lib/mastodon/streaming/message_parser.rb
Constant Summary collapse
- MESSAGE_TYPES =
{ 'update' => Status, 'notification' => Notification, 'delete' => DeletedStatus }.freeze
Class Method Summary collapse
Class Method Details
.parse(type, data) ⇒ Object
15 16 17 18 |
# File 'lib/mastodon/streaming/message_parser.rb', line 15 def self.parse(type, data) klass = MESSAGE_TYPES[type] klass&.new(data) end |