Commit f896caee authored by Chantal's avatar Chantal

return string when search_by_id doesn't find the id

parent a8979651
...@@ -31,8 +31,12 @@ module Wedoops ...@@ -31,8 +31,12 @@ module Wedoops
def search_by_id(id) def search_by_id(id)
resultado = self.class.get("/v1/leads/#{id}",headers:{'Content-Type' => 'application/json','x-apikey' => "#{@key}"}) resultado = self.class.get("/v1/leads/#{id}",headers:{'Content-Type' => 'application/json','x-apikey' => "#{@key}"})
if resultado.key?("message")
return resultado["message"]
else
return resultado["lead"].symbolize_keys return resultado["lead"].symbolize_keys
end end
end
def lifetime(id) def lifetime(id)
resultado = self.class.get("/v1/leads/#{id}/lifetime",headers:{'Content-Type' => 'application/json','x-apikey' => "#{@key}"}) resultado = self.class.get("/v1/leads/#{id}/lifetime",headers:{'Content-Type' => 'application/json','x-apikey' => "#{@key}"})
......
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