lib/centaman/service.rb in centaman-2.0.0 vs lib/centaman/service.rb in centaman-2.1.0
- old
+ new
@@ -42,9 +42,19 @@
resp = wrap_request_in_case_of_timeout(req)
self.respond_to?(:build_object) ? after_post(resp) : resp
end
end
+ def put
+ @put_request ||= begin
+ req = Proc.new do
+ self.class.put(endpoint, payload(:put))
+ end
+ resp = wrap_request_in_case_of_timeout(req)
+ self.respond_to?(:build_object) ? after_post(resp) : resp
+ end
+ end
+
def after_post(response)
build_object(response)
end
def payload(request_type = :get)