lib/3scale/api/http_client.rb in 3scale-api-0.1.1 vs lib/3scale/api/http_client.rb in 3scale-api-0.1.2

- old
+ new

@@ -32,10 +32,14 @@ def get(path) parse @http.get("#{path}.#{format}", headers) end + def patch(path, body: ) + parse @http.patch("#{path}.#{format}", serialize(body), headers) + end + def post(path, body: ) parse @http.post("#{path}.#{format}", serialize(body), headers) end def delete(path) @@ -80,10 +84,10 @@ module JSONParser module_function def decode(string) case string - when ' '.freeze, ''.freeze then nil + when nil, ' '.freeze, ''.freeze then nil else ::JSON.parse(string) end end def encode(query)