lib/api-client/class_methods.rb in api-client-2.6.0 vs lib/api-client/class_methods.rb in api-client-2.7.0

- old
+ new

@@ -32,13 +32,13 @@ # Make a put requisition and initialize an object with the response. # # @param [Hash] attributes hash with the attributes to send. # @param [Hash] header hash with the header options. # @return [Base] the object initialized. - def put(attributes, header = {}) + def put(id, attributes, header = {}) return new(attributes) if ApiClient.config.mock - url = "#{ApiClient.config.path[path]}#{self.resource_path}" + url = "#{ApiClient.config.path[path]}#{self.resource_path}/#{id}" response = ApiClient::Dispatcher.put(url, attributes, header) build(response, url) end alias_method :update_attributes, :put @@ -46,12 +46,12 @@ # Make a patch requisition and initialize an object with the response. # # @param [Hash] attributes hash with the attributes to send. # @param [Hash] header hash with the header options. # @return [Base] the object initialized. - def patch(attributes, header = {}) + def patch(id, attributes, header = {}) return new(attributes) if ApiClient.config.mock - url = "#{ApiClient.config.path[path]}#{self.resource_path}" + url = "#{ApiClient.config.path[path]}#{self.resource_path}/#{id}" response = ApiClient::Dispatcher.patch(url, attributes, header) build(response, url) end # Make a delete requisition and initialize an object with the response. \ No newline at end of file