Class: Cb::CbJob
- Inherits:
-
Object
- Object
- Cb::CbJob
- Defined in:
- lib/cb/models/cb_job.rb
Instance Attribute Summary collapse
-
#apply_url ⇒ Object
Returns the value of attribute apply_url.
-
#begin_date ⇒ Object
Returns the value of attribute begin_date.
-
#bonus ⇒ Object
Returns the value of attribute bonus.
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#category_codes ⇒ Object
Returns the value of attribute category_codes.
-
#city ⇒ Object
Returns the value of attribute city.
-
#commission ⇒ Object
Returns the value of attribute commission.
-
#company ⇒ Object
Returns the value of attribute company.
-
#company_details_url ⇒ Object
Returns the value of attribute company_details_url.
-
#company_did ⇒ Object
Returns the value of attribute company_did.
-
#company_image_url ⇒ Object
Returns the value of attribute company_image_url.
-
#company_name ⇒ Object
Returns the value of attribute company_name.
-
#contact_email_url ⇒ Object
Returns the value of attribute contact_email_url.
-
#contact_fax ⇒ Object
Returns the value of attribute contact_fax.
-
#contact_name ⇒ Object
Returns the value of attribute contact_name.
-
#contact_phone ⇒ Object
Returns the value of attribute contact_phone.
-
#degree_required ⇒ Object
Returns the value of attribute degree_required.
-
#description ⇒ Object
Returns the value of attribute description.
-
#description_teaser ⇒ Object
Returns the value of attribute description_teaser.
-
#details_url ⇒ Object
Returns the value of attribute details_url.
-
#did ⇒ Object
Returns the value of attribute did.
-
#distance ⇒ Object
Returns the value of attribute distance.
-
#employment_type ⇒ Object
Returns the value of attribute employment_type.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#experience_required ⇒ Object
Returns the value of attribute experience_required.
-
#external_application ⇒ Object
writeonly
Sets the attribute external_application.
-
#external_apply_url ⇒ Object
Returns the value of attribute external_apply_url.
-
#industry_codes ⇒ Object
Returns the value of attribute industry_codes.
-
#is_screener_apply ⇒ Object
writeonly
Sets the attribute is_screener_apply.
-
#is_shared_job ⇒ Object
writeonly
Sets the attribute is_shared_job.
-
#job_branding ⇒ Object
Returns the value of attribute job_branding.
-
#job_skin ⇒ Object
Returns the value of attribute job_skin.
-
#job_skin_did ⇒ Object
Returns the value of attribute job_skin_did.
-
#job_tracking_url ⇒ Object
Returns the value of attribute job_tracking_url.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#location ⇒ Object
Returns the value of attribute location.
-
#location_formatted ⇒ Object
Returns the value of attribute location_formatted.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#manages_others ⇒ Object
writeonly
Sets the attribute manages_others.
-
#manages_others_code ⇒ Object
Returns the value of attribute manages_others_code.
-
#pay ⇒ Object
Returns the value of attribute pay.
-
#pay_other ⇒ Object
Returns the value of attribute pay_other.
-
#pay_per ⇒ Object
Returns the value of attribute pay_per.
-
#posted_date ⇒ Object
Returns the value of attribute posted_date.
-
#relevancy ⇒ Object
Returns the value of attribute relevancy.
-
#relocation_covered ⇒ Object
writeonly
Sets the attribute relocation_covered.
-
#requirements ⇒ Object
Returns the value of attribute requirements.
-
#service_url ⇒ Object
Returns the value of attribute service_url.
-
#similar_jobs_url ⇒ Object
Returns the value of attribute similar_jobs_url.
-
#state ⇒ Object
Returns the value of attribute state.
-
#title ⇒ Object
Returns the value of attribute title.
-
#travel_required ⇒ Object
Returns the value of attribute travel_required.
-
#zip ⇒ Object
Returns the value of attribute zip.
Instance Method Summary collapse
- #external_application? ⇒ Boolean
- #find_company ⇒ Object
-
#initialize(args = {}) ⇒ CbJob
constructor
with a job.
- #manages_others? ⇒ Boolean
- #relocation_covered? ⇒ Boolean
- #screener_apply? ⇒ Boolean
- #shared_job? ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ CbJob
with a job. The API objects dealing with job, will populate one or many of this object.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/cb/models/cb_job.rb', line 22 def initialize(args = {}) return if args.nil? # General @did = args['DID'] || args['JobDID'] || '' @title = args['JobTitle'] || args['Title'] || '' @employment_type = args['EmploymentType'] || '' @latitude = args['LocationLatitude'] || '' @longitude = args['LocationLongitude'] || '' @location_formatted = args['LocationFormatted'] || '' # Job Skin Related @job_skin = args.has_key?("JobSkin") && !args["JobSkin"].nil? ? args['JobSkin']['#cdata-section'] : '' @job_skin_did = args['JobSkinDID'] || '' @job_branding = @job_skin_did.blank? ? '' : Cb.job_branding.find_by_id(job_skin_did) @job_tracking_url = args['JobTrackingURL'] || '' # Compensation @pay = args['PayHighLowFormatted'] || '' @pay_per = args['PayPer'] || '' @commission = args.has_key?("PayCommission") && !args["PayCommission"].nil? ? args['PayCommission']['Money']['FormattedAmount'] : '' @bonus = args.has_key?("PayBonus") && !args["PayBonus"].nil? ? args['PayBonus']['Money']['FormattedAmount'] : '' @pay_other = args.has_key?("PayOther") && !args["PayOther"].nil? ? args['PayOther'] : '' # Job Search related @description_teaser = args['DescriptionTeaser'] || '' @posted_date = args['PostedDate'] || '' @distance = args['Distance'] || '' @details_url = args['JobDetailsURL'] || '' @service_url = args['JobServiceURL'] || '' @location = args['Location'] || '' @similar_jobs_url = args['SimilarJobsURL'] || '' # Summary @categories = args['Categories'] || '' @category_codes = args['CategoriesCodes'] || '' @degree_required = args['DegreeRequiredCode'] || '' @experience_required = args['ExperienceRequiredCode'] || '' @travel_required = args['TravelRequiredCode'] || '' @relocation_covered = args['RelocationCovered'] || '' @industry_codes = args['IndustryCodes'] || '' @manages_others = args['ManagesOthers'] || '' @manages_others_code = args['ManagesOthersCode'] || '' # Contact Info @contact_email_url = args['ContactInfoEmailURL'] || '' @contact_fax = args['ContactInfoFax'] || '' @contact_name = args['ContactInfoName'] || '' @contact_phone = args['ContactInfoPhone'] || '' # Job Details related @description = args['Description'] || args['JobDescription'] || '' @requirements = args['JobRequirements'] || '' @begin_date = args['BeginDate'] || '' @end_date = args['EndDate'] || '' # Application @apply_url = args['ApplyURL'] || '' @external_apply_url = args['ExternalApplyURL'] || '' @external_application = args['ExternalApplication'] || '' @is_screener_apply = args['IsScreenerApply'] || '' @is_shared_job = args['IsSharedJob'] || '' # Company related @company_name = args['Company'] || '' @company_did = args['CompanyDID'] || '' @company_details_url = args['CompanyDetailsURL'] || '' @company_image_url = args['CompanyImageURL'] || '' # Recommendations related @relevancy = args['Relevancy'] || '' @state = args['LocationState'] || '' @city = args['LocationCity'] || '' @zip = args['LocationPostalCode'] || '' @company_name = args['Company']['CompanyName'] unless args['Company'].nil? || args['Company']['CompanyName'].nil? @company_details_url = args['Company']['CompanyDetailsURL'] unless args['Company'].nil? || args['Company']['CompanyDetailsURL'].nil? end |
Instance Attribute Details
#apply_url ⇒ Object
Returns the value of attribute apply_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def apply_url @apply_url end |
#begin_date ⇒ Object
Returns the value of attribute begin_date.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def begin_date @begin_date end |
#bonus ⇒ Object
Returns the value of attribute bonus.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def bonus @bonus end |
#categories ⇒ Object
Returns the value of attribute categories.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def categories @categories end |
#category_codes ⇒ Object
Returns the value of attribute category_codes.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def category_codes @category_codes end |
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def city @city end |
#commission ⇒ Object
Returns the value of attribute commission.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def commission @commission end |
#company ⇒ Object
Returns the value of attribute company.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def company @company end |
#company_details_url ⇒ Object
Returns the value of attribute company_details_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def company_details_url @company_details_url end |
#company_did ⇒ Object
Returns the value of attribute company_did.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def company_did @company_did end |
#company_image_url ⇒ Object
Returns the value of attribute company_image_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def company_image_url @company_image_url end |
#company_name ⇒ Object
Returns the value of attribute company_name.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def company_name @company_name end |
#contact_email_url ⇒ Object
Returns the value of attribute contact_email_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def contact_email_url @contact_email_url end |
#contact_fax ⇒ Object
Returns the value of attribute contact_fax.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def contact_fax @contact_fax end |
#contact_name ⇒ Object
Returns the value of attribute contact_name.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def contact_name @contact_name end |
#contact_phone ⇒ Object
Returns the value of attribute contact_phone.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def contact_phone @contact_phone end |
#degree_required ⇒ Object
Returns the value of attribute degree_required.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def degree_required @degree_required end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def description @description end |
#description_teaser ⇒ Object
Returns the value of attribute description_teaser.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def @description_teaser end |
#details_url ⇒ Object
Returns the value of attribute details_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def details_url @details_url end |
#did ⇒ Object
Returns the value of attribute did.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def did @did end |
#distance ⇒ Object
Returns the value of attribute distance.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def distance @distance end |
#employment_type ⇒ Object
Returns the value of attribute employment_type.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def employment_type @employment_type end |
#end_date ⇒ Object
Returns the value of attribute end_date.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def end_date @end_date end |
#experience_required ⇒ Object
Returns the value of attribute experience_required.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def experience_required @experience_required end |
#external_application=(value) ⇒ Object (writeonly)
Sets the attribute external_application
14 15 16 |
# File 'lib/cb/models/cb_job.rb', line 14 def external_application=(value) @external_application = value end |
#external_apply_url ⇒ Object
Returns the value of attribute external_apply_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def external_apply_url @external_apply_url end |
#industry_codes ⇒ Object
Returns the value of attribute industry_codes.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def industry_codes @industry_codes end |
#is_screener_apply=(value) ⇒ Object (writeonly)
Sets the attribute is_screener_apply
14 15 16 |
# File 'lib/cb/models/cb_job.rb', line 14 def is_screener_apply=(value) @is_screener_apply = value end |
#is_shared_job=(value) ⇒ Object (writeonly)
Sets the attribute is_shared_job
14 15 16 |
# File 'lib/cb/models/cb_job.rb', line 14 def is_shared_job=(value) @is_shared_job = value end |
#job_branding ⇒ Object
Returns the value of attribute job_branding.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def job_branding @job_branding end |
#job_skin ⇒ Object
Returns the value of attribute job_skin.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def job_skin @job_skin end |
#job_skin_did ⇒ Object
Returns the value of attribute job_skin_did.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def job_skin_did @job_skin_did end |
#job_tracking_url ⇒ Object
Returns the value of attribute job_tracking_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def job_tracking_url @job_tracking_url end |
#latitude ⇒ Object
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def latitude @latitude end |
#location ⇒ Object
Returns the value of attribute location.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def location @location end |
#location_formatted ⇒ Object
Returns the value of attribute location_formatted.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def location_formatted @location_formatted end |
#longitude ⇒ Object
Returns the value of attribute longitude.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def longitude @longitude end |
#manages_others=(value) ⇒ Object (writeonly)
Sets the attribute manages_others
14 15 16 |
# File 'lib/cb/models/cb_job.rb', line 14 def manages_others=(value) @manages_others = value end |
#manages_others_code ⇒ Object
Returns the value of attribute manages_others_code.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def manages_others_code @manages_others_code end |
#pay ⇒ Object
Returns the value of attribute pay.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def pay @pay end |
#pay_other ⇒ Object
Returns the value of attribute pay_other.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def pay_other @pay_other end |
#pay_per ⇒ Object
Returns the value of attribute pay_per.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def pay_per @pay_per end |
#posted_date ⇒ Object
Returns the value of attribute posted_date.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def posted_date @posted_date end |
#relevancy ⇒ Object
Returns the value of attribute relevancy.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def relevancy @relevancy end |
#relocation_covered=(value) ⇒ Object (writeonly)
Sets the attribute relocation_covered
14 15 16 |
# File 'lib/cb/models/cb_job.rb', line 14 def relocation_covered=(value) @relocation_covered = value end |
#requirements ⇒ Object
Returns the value of attribute requirements.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def requirements @requirements end |
#service_url ⇒ Object
Returns the value of attribute service_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def service_url @service_url end |
#similar_jobs_url ⇒ Object
Returns the value of attribute similar_jobs_url.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def similar_jobs_url @similar_jobs_url end |
#state ⇒ Object
Returns the value of attribute state.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def state @state end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def title @title end |
#travel_required ⇒ Object
Returns the value of attribute travel_required.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def travel_required @travel_required end |
#zip ⇒ Object
Returns the value of attribute zip.
3 4 5 |
# File 'lib/cb/models/cb_job.rb', line 3 def zip @zip end |
Instance Method Details
#external_application? ⇒ Boolean
110 111 112 |
# File 'lib/cb/models/cb_job.rb', line 110 def external_application? @external_application.downcase == 'true' ? true : false end |
#find_company ⇒ Object
100 101 102 103 104 105 106 107 108 |
# File 'lib/cb/models/cb_job.rb', line 100 def find_company if @company return @company else @company = Cb::CompanyApi.find_for self return @company end end |
#manages_others? ⇒ Boolean
118 119 120 |
# File 'lib/cb/models/cb_job.rb', line 118 def manages_others? @manages_others.downcase == 'true' ? true : false end |
#relocation_covered? ⇒ Boolean
114 115 116 |
# File 'lib/cb/models/cb_job.rb', line 114 def relocation_covered? @relocation_covered.downcase == 'true' ? true : false end |
#screener_apply? ⇒ Boolean
122 123 124 |
# File 'lib/cb/models/cb_job.rb', line 122 def screener_apply? @is_screener_apply.downcase == 'true' ? true : false end |
#shared_job? ⇒ Boolean
126 127 128 |
# File 'lib/cb/models/cb_job.rb', line 126 def shared_job? @is_shared_job.downcase == 'true' ? true : false end |