Method: Faye::Server#make_response

Defined in:
lib/faye/protocol/server.rb

#make_response(message) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/faye/protocol/server.rb', line 70

def make_response(message)
  response = {}

  response['id']       = message['id']       if message['id']
  response['clientId'] = message['clientId'] if message['clientId']
  response['channel']  = message['channel']  if message['channel']
  response['error']    = message['error']    if message['error']

  response['successful'] = !response['error']
  response
end