The Mongrel2
JSON Request class. Instances of this class represent a JSSocket request from a Mongrel2
server.
The parsed request data
Parse the body as JSON.
# File lib/mongrel2/jsonrequest.rb, line 22
def initialize( sender_id, conn_id, path, headers, body, raw=nil )
super
self.log.debug "Parsing JSON request body"
@data = Yajl.load( body )
self.log.debug " body is: %p" % [ @data ]
end
Returns true
if the request is a special Mongrel2
'disconnect' notification.
# File lib/mongrel2/jsonrequest.rb, line 40
def is_disconnect?
return true if self.data['type'] == 'disconnect'
end