File: json_response.rb

package info (click to toggle)
ruby-em-http-request 1.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 628 kB
  • ctags: 243
  • sloc: ruby: 3,478; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 272 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'multi_json'

module EventMachine
  module Middleware
    class JSONResponse
      def response(resp)
        begin
          body = MultiJson.load(resp.response)
          resp.response = body
        rescue Exception => e
        end
      end
    end
  end
end