blob: 0f1d7c87732e2dfca889d5427b487c01fc3b8029 (
plain) (
tree)
|
|
#= require_self
#= require cable/subscriber_manager
#= require cable/connection
#= require cable/channel
class @Cable
@PING_IDENTIFIER: "_ping"
constructor: (@url) ->
@subscribers = new Cable.SubscriberManager this
@connection = new Cable.Connection this
createChannel: (channelName, mixin) ->
channel = channelName
params = if typeof channel is "object" then channel else {channel}
new Cable.Channel this, params, mixin
send: (data) ->
@connection.send(data)
|