Commit b35a31f0 authored by Chantal's avatar Chantal

make upsert available

parent b93f9ab7
......@@ -132,6 +132,19 @@ module Wedoops
return manage_response(response,{:method=>__method__,:parameters => method(__method__).parameters.map { |arg| arg[1].to_s }})
end
def upsert(url,data)
raise "Invalid JSON!" unless valid_json?(data)
self.login?
options = {}
#Ojo, aqui tal vez deberiamos coprobar que viene con la forma :data => [:coleccion]
options[:body]=data
options.merge!(build_header)
response=self.class.put("/#{url}",options)
@logger.debug("#{__method__}:#{response.request.last_uri.to_s}")
return manage_response(response,{:method=>__method__,:parameters => method(__method__).parameters.map { |arg| arg[1].to_s }})
end
def query(coql)
self.login?
options = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment