lib/aitch/response_parser/json_parser.rb in aitch-1.0.0 vs lib/aitch/response_parser/json_parser.rb in aitch-1.0.1
- old
+ new
@@ -1,18 +1,24 @@
# frozen_string_literal: true
module Aitch
module ResponseParser
module JSONParser
+ class << self
+ attr_accessor :engine
+ end
+
+ self.engine = ::JSON
+
def self.type
:json
end
def self.match?(content_type)
content_type =~ /json/
end
def self.load(source)
- ::JSON.load(source.to_s)
+ engine.load(source.to_s)
end
end
end
end