Class: ActionChannels::Channels::NewsChannel

Inherits:
Base
  • Object
show all
Defined in:
lib/action_channels/channels/news_channel.rb

Instance Attribute Summary

Attributes inherited from Base

#clients, #message_sender, #name

Instance Method Summary collapse

Methods inherited from Base

#add_client, #after_message_subscribe, #after_message_unsubscribe, #initialize, #notify_all, #process_message, #process_system_message, #remove_client, #send_message

Constructor Details

This class inherits a constructor from ActionChannels::Channels::Base

Instance Method Details

#process_custom_message(message) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/action_channels/channels/news_channel.rb', line 4

def process_custom_message(message)
  case message.type
  when 'publish'
    on_publish message.author, message.details
  else
    on_unknown_type_message message
  end
end