Class: Cb::CompanyApi
- Inherits:
-
Object
- Object
- Cb::CompanyApi
- Defined in:
- lib/cb/clients/company_api.rb
Class Method Summary collapse
-
.find_by_did(did) ⇒ Object
Retrieve a company by did.
- .find_for(obj) ⇒ Object
Class Method Details
.find_by_did(did) ⇒ Object
Retrieve a company by did
For detailed information around this API please visit: http://api.careerbuilder.com/CompanyDetailsInfo.aspx
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/cb/clients/company_api.rb', line 11 def self.find_by_did(did) my_api = Cb::Utils::Api.new() cb_response = my_api.cb_get(Cb.configuration.uri_company_find, :query => {:CompanyDID => did, :hostsite=> Cb.configuration.host_site}) json_hash = JSON.parse(cb_response.response.body) company = CbCompany.new(json_hash['Results']['CompanyProfileDetail']) my_api.append_api_responses(company, json_hash['Results']) return company end |
.find_for(obj) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cb/clients/company_api.rb', line 22 def self.find_for(obj) if obj.is_a?(String) did = obj elsif obj.is_a?(Cb::CbJob) did = obj.company_did end did ||= '' find_by_did did unless did.empty? end |