class ActionChannels::Channels::NewsChannel

Public Instance Methods

process_custom_message(message) click to toggle source
# 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

Private Instance Methods

on_publish(speaker, details) click to toggle source
# File lib/action_channels/channels/news_channel.rb, line 15
def on_publish(speaker, details)
  notify_all Message.new(channel: name, type: 'news', details: details)
  send_message speaker, Message.new(channel: name, type: 'published')
end