lib/duracloud/client.rb in duracloud-client-0.3.0 vs lib/duracloud/client.rb in duracloud-client-0.4.0

- old
+ new

@@ -4,12 +4,12 @@ class Client extend Forwardable extend RestMethods include RestMethods - def self.execute(request_class, http_method, url, **options) - new.execute(request_class, http_method, url, **options) + def self.execute(request_class, http_method, url, **options, &block) + new.execute(request_class, http_method, url, **options, &block) end def self.configure yield Configuration end @@ -20,12 +20,12 @@ def initialize(**options) @config = Configuration.new(**options) end - def execute(request_class, http_method, url, **options) + def execute(request_class, http_method, url, **options, &block) request = request_class.new(self, http_method, url, **options) - response = request.execute + response = request.execute(&block) handle_response(response) response end private