Class: Recruitee::API::InterviewEvents

Inherits:
Recruitee::APIResource show all
Defined in:
lib/recruitee/api/interview_events.rb

Instance Attribute Summary

Attributes inherited from Recruitee::APIResource

#client, #resource_klass

Instance Method Summary collapse

Methods inherited from Recruitee::APIResource

#destroy, #find, #list, #resource_name, #update

Constructor Details

#initialize(client) ⇒ InterviewEvents

Returns a new instance of InterviewEvents.



6
7
8
# File 'lib/recruitee/api/interview_events.rb', line 6

def initialize(client)
  super(client, InterviewEvent)
end

Instance Method Details

#create(candidate_id:, **interview_event) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/recruitee/api/interview_events.rb', line 10

def create(candidate_id:, **interview_event)
  payload = request(
    :post,
    "/interview/candidates/#{candidate_id}/events",
    body: { interview_event: interview_event }
  )

  initialize_from(payload[resource_name])
end

#resource_urlObject



27
28
29
# File 'lib/recruitee/api/interview_events.rb', line 27

def resource_url
  '/interview/events'
end

#schedule(id, data = {}) ⇒ Object



20
21
22
23
24
25
# File 'lib/recruitee/api/interview_events.rb', line 20

def schedule(id, data = {})
  body = namespaced_body(data)
  payload = request(:post, "#{resource_url}/#{id}/schedule", body: body)

  initialize_from(payload[resource_name])
end