We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d811399 commit 19695e3Copy full SHA for 19695e3
lib/resque/json_coder.rb
@@ -4,22 +4,14 @@
4
module Resque
5
class JsonCoder < Coder
6
def encode(object)
7
- if JSON.respond_to?(:dump) && JSON.respond_to?(:load)
8
- JSON.dump object
9
- else
10
- JSON.encode object
11
- end
+ JSON.dump object
12
end
13
14
def decode(object)
15
return unless object
16
17
begin
18
19
- JSON.load object
20
21
- JSON.decode object
22
+ JSON.load object
23
rescue JSON::ParserError => e
24
raise DecodeException, e.message, e.backtrace
25
0 commit comments