Sha256: 53063d91e14454cdcbd357af8f0a99c0b9db384412fdefdab113573dd3c149d2
Contents?: true
Size: 901 Bytes
Versions: 21
Compression:
Stored size: 901 Bytes
Contents
### The Event object stores all the relevant event information. ### class WebSocketRails.Event constructor: (data,@success_callback,@failure_callback) -> @name = data[0] attr = data[1] if attr? @id = if attr['id']? then attr['id'] else (((1+Math.random())*0x10000)|0) @channel = if attr.channel? then attr.channel @data = if attr.data? then attr.data else attr @connection_id = data[2] if attr.success? @result = true @success = attr.success is_channel: => @channel? is_result: => @result == true is_ping: => @name == 'websocket_rails.ping' serialize: => JSON.stringify [@name, @attributes()] attributes: => id: @id, channel: @channel, data: @data run_callbacks: (success,data) => if success == true @success_callback?(data) else @failure_callback?(data)
Version data entries
21 entries across 21 versions & 1 rubygems