Class: Youlend::Lead

Inherits:
Object
  • Object
show all
Defined in:
lib/youlend/lead.rb

Class Method Summary collapse

Class Method Details

.accept_offer(lead_id, offer_id) ⇒ Object



22
23
24
# File 'lib/youlend/lead.rb', line 22

def self.accept_offer(lead_id, offer_id)
  Youlend.connection.post("/onboarding/Leads/#{lead_id}/offers/#{offer_id}/acceptance", :onboarding)
end

.create(params) ⇒ Object



6
7
8
# File 'lib/youlend/lead.rb', line 6

def self.create(params)
  Youlend.connection.post('/onboarding/Leads', :onboarding, params)
end

.details(lead_id) ⇒ Object



14
15
16
# File 'lib/youlend/lead.rb', line 14

def self.details(lead_id)
  Youlend.connection.get("/onboarding/Leads/#{lead_id}/details", :onboarding)
end

.offers(lead_id) ⇒ Object



18
19
20
# File 'lib/youlend/lead.rb', line 18

def self.offers(lead_id)
  Youlend.connection.get("/onboarding/Leads/#{lead_id}/offers", :onboarding)
end


26
27
28
29
30
31
# File 'lib/youlend/lead.rb', line 26

def self.onboard_link(lead_id, email_address)
  domain = Youlend.configuration.domain

  url = Addressable::Template.new("#{domain}/dashboard/youlendapisignup{?query*}")
  url.expand(query: { emailAddress: email_address, leadId: lead_id }).to_s
end

.update(lead_id, params) ⇒ Object



10
11
12
# File 'lib/youlend/lead.rb', line 10

def self.update(lead_id, params)
  Youlend.connection.put("/onboarding/Leads/#{lead_id}/organisationdetails", :onboarding, params)
end