module Parser
Module Parser
returns the event to be executed
@author Maanav Shah <shahmaanav07@gmail.com>
Constants
- ACKNOWLEDGEMENT
- CHECK_AUTHENTICATION
- EVENT
- PUBLISH
- REMOVE_AUTHENTICATION
- SET_AUTHENTICATION
Public Class Methods
parse(event, rid)
click to toggle source
Provides a handler for a particular event
@param [String] event An event to execute @param [Integer] rid An id received from ScServer
@return [Enum] Result of parsing event and rid
# File lib/socketclusterclient/parser.rb, line 22 def self.parse(event, rid) if event.to_s != '' if event == '#publish' PUBLISH elsif event == '#removeAuthToken' REMOVE_AUTHENTICATION elsif event == '#setAuthToken' SET_AUTHENTICATION else EVENT end elsif rid == 1 CHECK_AUTHENTICATION else ACKNOWLEDGEMENT end end