Class: Cb::ResumeApi
- Inherits:
-
Object
- Object
- Cb::ResumeApi
- Defined in:
- lib/cb/clients/resume_api.rb
Class Method Summary collapse
-
.create(resume) ⇒ Object
TODO: Create a resume.
-
.delete(resume) ⇒ Object
TODO: Delete a resume.
-
.own_all(external_user_id, ignore_host_site = false) ⇒ Object
Retrieve resumes a user owns.
-
.retrieve(resume) ⇒ Object
Retrieve the contents of a resume.
-
.retrieve_by_id(resume_external_id, external_user_id) ⇒ Object
Retrieve the contents of a resume by external id.
-
.update(resume) ⇒ Object
TODO: Update a resume.
Class Method Details
.create(resume) ⇒ Object
TODO: Create a resume
For detailed information around this API please visit: http://www.careerbuilder.com/api/ResumeInfo.aspx
83 84 85 86 |
# File 'lib/cb/clients/resume_api.rb', line 83 def self.create resume my_api = Cb::Utils::Api.new json_hash = my_api.cb_post(Cb.configuration.uri_resume_create, :body => make_create_xml(resume)) end |
.delete(resume) ⇒ Object
TODO: Delete a resume
For detailed information around this API please visit: http://www.careerbuilder.com/api/ResumeInfo.aspx
105 106 107 108 |
# File 'lib/cb/clients/resume_api.rb', line 105 def self.delete resume my_api = Cb::Utils::Api.new json_hash = my_api.cb_post(Cb.configuration.uri_resume_delete, :body => make_delete_xml(resume)) end |
.own_all(external_user_id, ignore_host_site = false) ⇒ Object
Retrieve resumes a user owns.
Returns an array of resumes with external id and title set.
Note: This does not load the resume, a subsequent resume retrieve is required.
For detailed information around this API please visit: http://www.careerbuilder.com/api/ResumeInfo.aspx
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cb/clients/resume_api.rb', line 17 def self.own_all(external_user_id, ignore_host_site = false) my_api = Cb::Utils::Api.new params = {"ExternalUserID" => external_user_id} if ignore_host_site params['IgnoreHostSite'] = 'true' end json_hash = my_api.cb_get(Cb.configuration.uri_resume_own_all, :query => params) resumes = [] if json_hash.has_key?('ResponseOwnResumes') && json_hash['ResponseOwnResumes'].has_key?('Resumes') json_hash['ResponseOwnResumes']['Resumes']['Resume'].each do |resume_hash| resume = Cb::CbResume.new resume_hash resume.external_resume_id = resume_hash['ExternalID'] resume.external_user_id = external_user_id resumes << resume end end return resumes end |
.retrieve(resume) ⇒ Object
Retrieve the contents of a resume.
For detailed information around this API please visit: http://www.careerbuilder.com/api/ResumeInfo.aspx
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cb/clients/resume_api.rb', line 64 def self.retrieve resume my_api = Cb::Utils::Api.new params = {"ExternalID" => resume.external_resume_id, "ExternalUserID" => resume.external_user_id} json_hash = my_api.cb_get(Cb.configuration.uri_resume_retrieve, :query => params) if json_hash.has_key?('ResponseRetrieve') && json_hash['ResponseRetrieve'].has_key?('Resume') resume = resume.set_attributes json_hash['ResponseRetrieve']['Resume'] my_api.append_api_responses resume, json_hash['ResponseRetrieve'] end return resume end |
.retrieve_by_id(resume_external_id, external_user_id) ⇒ Object
Retrieve the contents of a resume by external id.
For detailed information around this API please visit: http://www.careerbuilder.com/api/ResumeInfo.aspx
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/cb/clients/resume_api.rb', line 45 def self.retrieve_by_id resume_external_id, external_user_id my_api = Cb::Utils::Api.new params = {"ExternalID" => external_id, "ExternalUserID" => external_user_id} json_hash = my_api.cb_get(Cb.configuration.uri_resume_retrieve, :query => params) if json_hash.has_key?('ResponseRetrieve') && json_hash['ResponseRetrieve'].has_key?('Resume') resume = Cb::CbResume.new json_hash['ResponseRetrieve']['Resume'] my_api.append_api_responses resume, json_hash['ResponseRetrieve'] end return resume end |
.update(resume) ⇒ Object
TODO: Update a resume
For detailed information around this API please visit: http://www.careerbuilder.com/api/ResumeInfo.aspx
94 95 96 97 |
# File 'lib/cb/clients/resume_api.rb', line 94 def self.update resume my_api = Cb::Utils::Api.new json_hash = my_api.cb_post(Cb.configuration.uri_resume_update, :body => make_update_xml(resume)) end |