Class: SmartRecruiters::CandidatesResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/smartrecruiters/resources/candidates.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from SmartRecruiters::Resource

Instance Method Details

#create(**attributes) ⇒ Object



14
15
16
# File 'lib/smartrecruiters/resources/candidates.rb', line 14

def create(**attributes)
  Candidate.new post_request('candidates', body: attributes).body
end

#delete(candidate_id:) ⇒ Object



22
23
24
# File 'lib/smartrecruiters/resources/candidates.rb', line 22

def delete(candidate_id:)
  delete_request("candidates/#{candidate_id}")
end

#list(**params) ⇒ Object



5
6
7
8
# File 'lib/smartrecruiters/resources/candidates.rb', line 5

def list(**params)
  response = get_request('candidates', params: params)
  Collection.from_response(response, type: Candidate)
end

#retrieve(candidate_id:) ⇒ Object



10
11
12
# File 'lib/smartrecruiters/resources/candidates.rb', line 10

def retrieve(candidate_id:)
  Candidate.new get_request("candidates/#{candidate_id}").body
end

#retrieve_application(candidate_id:, job_id:) ⇒ Object



34
35
36
# File 'lib/smartrecruiters/resources/candidates.rb', line 34

def retrieve_application(candidate_id:, job_id:)
  Object.new get_request("candidates/#{candidate_id}/jobs/#{job_id}").body
end

#retrieve_application_attachments(candidate_id:, job_id:) ⇒ Object



38
39
40
41
# File 'lib/smartrecruiters/resources/candidates.rb', line 38

def retrieve_application_attachments(candidate_id:, job_id:)
  response = get_request("candidates/#{candidate_id}/jobs/#{job_id}/attachments")
  Collection.from_response(response, type: Attachment)
end


26
27
28
# File 'lib/smartrecruiters/resources/candidates.rb', line 26

def retrieve_consent(candidate_id:)
  Object.new get_request("candidates/#{candidate_id}/consent").body
end

#retrieve_consents(candidate_id:) ⇒ Object



30
31
32
# File 'lib/smartrecruiters/resources/candidates.rb', line 30

def retrieve_consents(candidate_id:)
  Object.new get_request("candidates/#{candidate_id}/consents").body
end

#retrieve_status_history(candidate_id:, job_id:) ⇒ Object



43
44
45
46
# File 'lib/smartrecruiters/resources/candidates.rb', line 43

def retrieve_status_history(candidate_id:, job_id:)
  response = get_request("candidates/#{candidate_id}/jobs/#{job_id}/status/history")
  Collection.from_response(response, type: Object)
end

#update(candidate_id:, **attributes) ⇒ Object



18
19
20
# File 'lib/smartrecruiters/resources/candidates.rb', line 18

def update(candidate_id:, **attributes)
  Candidate.new patch_request("candidates/#{candidate_id}", body: attributes).body
end