Class: SmartRecruiters::ReviewsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/smartrecruiters/resources/reviews.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



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

def create(**attributes)
  Review.new post_request('reviews', body: attributes).body
end

#delete(review_id:, reviewer_id:) ⇒ Object



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

def delete(review_id:, reviewer_id:)
  delete_request("reviews/#{review_id}", params: { reviewerId: reviewer_id })
end

#list(candidate_id:, job_id:) ⇒ Object



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

def list(candidate_id:, job_id:)
  params = { candidateId: candidate_id, jobId: job_id }
  Collection.from_response get_request('reviews', params: params), type: Review
end

#retrieve(review_id:) ⇒ Object



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

def retrieve(review_id:)
  Review.new get_request("reviews/#{review_id}").body
end

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



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

def update(review_id:, **attributes)
  patch_request("reviews/#{review_id}", body: attributes)
end