Class: AjaxChatPluginComm

Inherits:
AjaxChatPlugin
  • Object
show all
Defined in:
lib/h2g_ajaxchat-plugin-comm.rb

Instance Method Summary collapse

Constructor Details

#initialize(ac, settings = {}, debug: false) ⇒ AjaxChatPluginComm

Returns a new instance of AjaxChatPluginComm.



13
14
15
16
17
18
# File 'lib/h2g_ajaxchat-plugin-comm.rb', line 13

def initialize(ac, settings={}, debug: false)
  
  super(ac, settings, debug: debug)
  @rsc = ac.rws.rsc
  
end

Instance Method Details

#messagesObject



20
21
22
23
24
# File 'lib/h2g_ajaxchat-plugin-comm.rb', line 20

def messages()
  
  @rsc.chat.shift_messages
  
end

#on_newmessage(t, userid, username, msg) ⇒ Object



26
27
28
29
30
# File 'lib/h2g_ajaxchat-plugin-comm.rb', line 26

def on_newmessage(t, userid, username, msg)

  @rsc.sps.notice "chat/%s: %s" % [username, msg]
  
end