lib/hyperclient/link.rb in hyperclient-0.3.2 vs lib/hyperclient/link.rb in hyperclient-0.4.0

- old
+ new

@@ -1,7 +1,8 @@ require 'hyperclient/resource' require 'uri_template' +require 'futuroscope' module Hyperclient # Internal: The Link is used to let a Resource interact with the API. # class Link @@ -98,34 +99,48 @@ def connection @entry_point.connection end def get - connection.get(url) + Futuroscope::Future.new{ + connection.get(url) + } end def options - connection.run_request(:options, url, nil, nil) + Futuroscope::Future.new{ + connection.run_request(:options, url, nil, nil) + } end def head - connection.head(url) + Futuroscope::Future.new{ + connection.head(url) + } end def delete - connection.delete(url) + Futuroscope::Future.new{ + connection.delete(url) + } end def post(params = {}) - connection.post(url, params) + Futuroscope::Future.new{ + connection.post(url, params) + } end def put(params = {}) - connection.put(url, params) + Futuroscope::Future.new{ + connection.put(url, params) + } end def patch(params = {}) - connection.patch(url, params) + Futuroscope::Future.new{ + connection.patch(url, params) + } end def inspect "#<#{self.class.name} #{@link}>" end