Skip to content

Commit 19695e3

Browse files
committed
remove feature check in json coder
1 parent d811399 commit 19695e3

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/resque/json_coder.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,14 @@
44
module Resque
55
class JsonCoder < Coder
66
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
7+
JSON.dump object
128
end
139

1410
def decode(object)
1511
return unless object
1612

1713
begin
18-
if JSON.respond_to?(:dump) && JSON.respond_to?(:load)
19-
JSON.load object
20-
else
21-
JSON.decode object
22-
end
14+
JSON.load object
2315
rescue JSON::ParserError => e
2416
raise DecodeException, e.message, e.backtrace
2517
end

0 commit comments

Comments
 (0)