Class: Fountain::Api::Notes
- Inherits:
-
Object
- Object
- Fountain::Api::Notes
- Extended by:
- RequestHelper
- Defined in:
- lib/fountain/api/notes.rb
Overview
Fountain Note Management API
Constant Summary
Constants included from RequestHelper
RequestHelper::DEFAULT_REQUEST_OPTIONS
Class Method Summary collapse
-
.create(applicant_id, content) ⇒ Fountain::Note
Create a Note for an Applicant.
-
.delete(applicant_id, note_id) ⇒ Boolean
Delete Applicant Note.
-
.list(applicant_id) ⇒ [Fountain::Note]
List Notes for an Applicant.
-
.update(applicant_id, note_id, content) ⇒ Fountain::Note
Update Applicant Note.
Methods included from RequestHelper
Class Method Details
.create(applicant_id, content) ⇒ Fountain::Note
Create a Note for an Applicant
25 26 27 28 29 30 31 32 33 |
# 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, Net::HTTPOK], body: { content: content } ) Fountain::Note.new response end |
.delete(applicant_id, note_id) ⇒ Boolean
Delete Applicant Note
40 41 42 43 44 45 46 47 |
# 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) ⇒ [Fountain::Note]
List Notes for an Applicant
15 16 17 18 |
# 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) ⇒ Fountain::Note
Update Applicant Note
55 56 57 58 59 60 61 62 |
# 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 |