Eii , pessoal alguém sabe me dizer oque isso significa em PHP ?
def find_leads(criteria=false)
#No criteria means search all by default
if not criteria
leads = @@intercom.get("/contacts", "")
if not leads.empty?
leads['contacts'].each {|contact| puts "EMAIL: #{contact['email']}, NAME: #{contact['name']}", \
"USER_ID: #{contact['user_id']}, ID: #{contact['id']}"}
end
else
#Lets use the criteria in different ways to search contacts
#Check against email
lead_list = @@intercom.contacts.find_all(:email => criteria)
#Check if email returned anything
if lead_list.any?
lead_list.each {|lead| puts "EMAIL: #{lead.email}, NAME: #{lead.name}", \
"USER_ID: #{lead.user_id}, ID: #{lead.id}"}
else
begin
lead = @@intercom.contacts.find(user_id: criteria)
return lead
rescue Intercom::ResourceNotFound
lead = @@intercom.contacts.find(id: criteria)
return lead
end
end
end
end
Pergunta
lucasbicalleto
Eii , pessoal alguém sabe me dizer oque isso significa em PHP ?
def find_leads(criteria=false) #No criteria means search all by default if not criteria leads = @@intercom.get("/contacts", "") if not leads.empty? leads['contacts'].each {|contact| puts "EMAIL: #{contact['email']}, NAME: #{contact['name']}", \ "USER_ID: #{contact['user_id']}, ID: #{contact['id']}"} end else #Lets use the criteria in different ways to search contacts #Check against email lead_list = @@intercom.contacts.find_all(:email => criteria) #Check if email returned anything if lead_list.any? lead_list.each {|lead| puts "EMAIL: #{lead.email}, NAME: #{lead.name}", \ "USER_ID: #{lead.user_id}, ID: #{lead.id}"} else begin lead = @@intercom.contacts.find(user_id: criteria) return lead rescue Intercom::ResourceNotFound lead = @@intercom.contacts.find(id: criteria) return lead end end end end
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.