Sha256: b9eb2f93426dcaae4d86f275642f8fbe008ff9a6943c1c2638ae2ce35614b925
Contents?: true
Size: 583 Bytes
Versions: 5
Compression:
Stored size: 583 Bytes
Contents
# Replace this sample with real code. class ExampleCtrl CHANNEL = "chat".freeze # HTTP def index # any String returned will be appended to the response. We return a String. render 'welcome' end # Websockets def on_open subscribe CHANNEL write 'Welcome to appname!' @handle = params['id'.freeze] || 'Somebody' publish CHANNEL, "#{ERB::Util.html_escape @handle} joind us :-)" end def on_message(data) data = ERB::Util.html_escape data publish CHANNEL, data end def on_close publish CHANNEL, "#{@handle} left us :-(" end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
plezi-0.16.4 | resources/ctrlr.rb |
plezi-0.16.3 | resources/ctrlr.rb |
plezi-0.16.2 | resources/ctrlr.rb |
plezi-0.16.1 | resources/ctrlr.rb |
plezi-0.16.0 | resources/ctrlr.rb |