class Cb::Clients::SavedJobs
Public Class Methods
create(args = {})
click to toggle source
# File lib/cb/clients/saved_jobs.rb, line 22 def create(args = {}) cb_client.cb_put(Cb.configuration.uri_saved_job, body: body(args), headers: headers(args)) end
delete(args = {})
click to toggle source
# File lib/cb/clients/saved_jobs.rb, line 28 def delete(args = {}) cb_client.cb_delete(uri_with_id(args), body: body(args), headers: headers(args)) end
get(args = {})
click to toggle source
# File lib/cb/clients/saved_jobs.rb, line 16 def get(args = {}) uri = Cb.configuration.uri_saved_job uri += "/#{ args[:id] }" if args[:id] cb_client.cb_get(uri, headers: headers(args)) end
update(args = {})
click to toggle source
# File lib/cb/clients/saved_jobs.rb, line 32 def update(args = {}) cb_client.cb_post(uri_with_id(args), body: body(args), headers: headers(args)) end
Private Class Methods
body(args)
click to toggle source
# File lib/cb/clients/saved_jobs.rb, line 42 def body(args) body = {} body[:id] = args[:id] if args[:id] body[:job_id] = args[:job_id] if args[:job_id] body[:job_title] = args[:job_title] if args[:job_title] body[:notes] = args[:notes] if args[:notes] body[:status] = args[:status] if args[:status] body[:application_date] = args[:application_date] if args[:application_date] body[:site] = args[:site] if args[:site] body.to_json end
uri_with_id(args)
click to toggle source
# File lib/cb/clients/saved_jobs.rb, line 38 def uri_with_id(args) "#{ Cb.configuration.uri_saved_job }/#{ args[:id] }" end