lib/pusher-fake/connection.rb
# Emit an event to the connection.
#
# @param [String] event The event name.
# @param [Hash] data The event data.
# @param [String] channel The channel name.
Emit an event to the connection.
Emit an event to the connection .
def emit(event, data = {}, channel = nil)
      message = { event: event, data: MultiJson.dump(data) }
      message[:channel] = channel if channel
      PusherFake.log("SEND #{id}: #{message}")
      socket.send(MultiJson.dump(message))
    end
def emit ( event , data = { } , channel = nil ) message = { event : event , data : MultiJson . dump ( data ) } message [ :channel ] = channel if channel PusherFake . log ( "SEND #{id}: #{message}" ) socket . send ( MultiJson . dump ( message ) ) end
Emit an event to the connection.
Emit an event to the connection .
event
<not_specific>
data
<not_specific>
channel
<not_specific>
<not_specific>
channel The channel name.
channel The channel name .