class Fountain::Api::Notes

Fountain Note Management API

Public Class Methods

create(applicant_id, content) click to toggle source

Create a Note for an Applicant @param [String] applicant_id ID of the Fountain applicant @param [String] content Content for the note @return [Fountain::Note]

# File lib/fountain/api/notes.rb, line 25
def self.create(applicant_id, content)
  response = request_json(
    "/v2/applicants/#{applicant_id}/notes",
    method: :post,
    expected_response: Net::HTTPCreated,
    body: { content: content }
  )
  Fountain::Note.new response
end
delete(applicant_id, note_id) click to toggle source

Delete Applicant Note @param [String] applicant_id ID of the Fountain applicant @param [String] note_id ID of the Fountain note @return [Boolean]

# File lib/fountain/api/notes.rb, line 40
def self.delete(applicant_id, note_id)
  response = request(
    "/v2/applicants/#{applicant_id}/notes/#{note_id}",
    method: :delete
  )
  check_response response
  true
end
list(applicant_id) click to toggle source

List Notes for an Applicant @param [String] applicant_id ID of the Fountain applicant @return [[Fountain::Note]]

# File lib/fountain/api/notes.rb, line 15
def self.list(applicant_id)
  response = request_json("/v2/applicants/#{applicant_id}/notes")
  response['notes'].map { |hash| Fountain::Note.new hash }
end
update(applicant_id, note_id, content) click to toggle source

Update Applicant Note @param [String] applicant_id ID of the Fountain applicant @param [String] note_id ID of the Fountain note @param [String] content Content for the note @return [Fountain::Note]

# File lib/fountain/api/notes.rb, line 55
def self.update(applicant_id, note_id, content)
  response = request_json(
    "/v2/applicants/#{applicant_id}/notes/#{note_id}",
    method: :put,
    body: { content: content }
  )
  Fountain::Note.new response
end