lib/restful_resource/base.rb in restful_resource-2.10.0 vs lib/restful_resource/base.rb in restful_resource-2.10.1

- old
+ new

@@ -34,11 +34,11 @@ end def self.find(id, **params) params_without_options, options = format_params(params) - response = http.get(member_url(id, params_without_options), **options) + response = http.get(member_url(id, **params_without_options), **options) new(parse_json(response.body)) end def self.where(**params) params_without_options, options = format_params(params) @@ -55,29 +55,29 @@ new(parse_json(response.body)) end def self.delete(id, **params) params_without_options, options = format_params(params) - response = http.delete(member_url(id, params_without_options), **options) + response = http.delete(member_url(id, **params_without_options), **options) new(parse_json(response.body)) end def self.patch(id, data: {}, headers: {}, **params) params_without_options, options = format_params(params) options.delete(:headers) - url = member_url(id, params_without_options) + url = member_url(id, **params_without_options) response = http.patch(url, data: data, headers: headers, **options) new(parse_json(response.body)) end def self.put(id, data: {}, headers: {}, **params) params_without_options, options = format_params(params) options.delete(:headers) - url = member_url(id, params_without_options) + url = member_url(id, **params_without_options) response = http.put(url, data: data, headers: headers, **options) new(parse_json(response.body)) end @@ -156,10 +156,10 @@ def self.member_url(id, **params) raise ResourceIdMissingError if id.blank? url = merge_url_paths(base_url, @resource_path, CGI.escape(id.to_s), @action_prefix) - replace_parameters(url, params) + replace_parameters(url, **params) end def self.new_collection(json) json.map do |element| new(element)