lib/quandl/client/middleware/parse_json.rb in quandl_client-2.4.9 vs lib/quandl/client/middleware/parse_json.rb in quandl_client-2.5.0
- old
+ new
@@ -1,5 +1,7 @@
+require 'json'
+
module Quandl
module Client
module Middleware
class ParseJSON < Faraday::Response::Middleware
@@ -56,11 +58,11 @@
end
def parse_json(body = nil, env)
body ||= '{}'
json = begin
- Yajl.load(body, :symbolize_keys => true)
- rescue Yajl::ParseError
+ JSON.parse(body).symbolize_keys!
+ rescue JSON::ParserError
nil
end
# invalid json body?
if json.blank?
# fallback to error message
\ No newline at end of file