lib/nationbuilder/client.rb in nationbuilder-rb-0.5.0 vs lib/nationbuilder/client.rb in nationbuilder-rb-0.6.0

- old
+ new

@@ -54,11 +54,19 @@ else nonmethod_args[:access_token] = @api_key request_args[:body] = JSON(nonmethod_args) end - response = HTTPClient.send(method.http_method, url, request_args) + set_response(HTTPClient.send(method.http_method, url, request_args)) return parse_response_body(response) + end + + def set_response(value) + Thread.current[:nationbuilder_rb_response] = value + end + + def response + Thread.current[:nationbuilder_rb_response] end class ServerResponseError < StandardError; end def parse_response_body(response)