Class: Cb::CbResume
- Inherits:
-
Object
- Object
- Cb::CbResume
- Defined in:
- lib/cb/models/implementations/cb_resume.rb
Defined Under Namespace
Classes: CbCompanyExperience, CbCustomValue, CbEducation, CbLanguage
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#birth_date ⇒ Object
Returns the value of attribute birth_date.
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#city ⇒ Object
Returns the value of attribute city.
-
#company_experiences ⇒ Object
Returns the value of attribute company_experiences.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#created_dt ⇒ Object
Returns the value of attribute created_dt.
-
#custom_values ⇒ Object
Returns the value of attribute custom_values.
-
#did ⇒ Object
Returns the value of attribute did.
-
#educations ⇒ Object
Returns the value of attribute educations.
-
#email ⇒ Object
Returns the value of attribute email.
-
#external_resume_id ⇒ Object
Returns the value of attribute external_resume_id.
-
#external_user_id ⇒ Object
Returns the value of attribute external_user_id.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#languages ⇒ Object
Returns the value of attribute languages.
-
#modified_dt ⇒ Object
Returns the value of attribute modified_dt.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#real_name ⇒ Object
Returns the value of attribute real_name.
-
#resume_text ⇒ Object
Returns the value of attribute resume_text.
-
#show_contact_info ⇒ Object
Returns the value of attribute show_contact_info.
-
#state ⇒ Object
Returns the value of attribute state.
-
#test ⇒ Object
Returns the value of attribute test.
-
#title ⇒ Object
Returns the value of attribute title.
-
#visibility ⇒ Object
Returns the value of attribute visibility.
Instance Method Summary collapse
- #add_company_experience(params) ⇒ Object
- #add_custom_value(params) ⇒ Object
- #add_education(params) ⇒ Object
- #add_language(params) ⇒ Object
- #certifications ⇒ Object
- #current_employed ⇒ Object
- #custom_value(custom_value_key) ⇒ Object
- #desired_job_type ⇒ Object
- #experience_in_months ⇒ Object
-
#initialize(args = {}) ⇒ CbResume
constructor
A new instance of CbResume.
- #it_skill ⇒ Object
- #job_type ⇒ Object
- #lang(id_lang) ⇒ Object
- #lang_prof(id_lang) ⇒ Object
- #langs ⇒ Object
- #load ⇒ Object
- #management_experience ⇒ Object
- #recent_income ⇒ Object
- #recent_income_currency_type ⇒ Object
- #recent_income_type ⇒ Object
- #set_attributes(args = {}) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ CbResume
Returns a new instance of CbResume.
13 14 15 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 13 def initialize(args = {}) set_attributes(args) end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def address @address end |
#birth_date ⇒ Object
Returns the value of attribute birth_date.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def birth_date @birth_date end |
#categories ⇒ Object
Returns the value of attribute categories.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def categories @categories end |
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def city @city end |
#company_experiences ⇒ Object
Returns the value of attribute company_experiences.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def company_experiences @company_experiences end |
#country_code ⇒ Object
Returns the value of attribute country_code.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def country_code @country_code end |
#created_dt ⇒ Object
Returns the value of attribute created_dt.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def created_dt @created_dt end |
#custom_values ⇒ Object
Returns the value of attribute custom_values.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def custom_values @custom_values end |
#did ⇒ Object
Returns the value of attribute did.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def did @did end |
#educations ⇒ Object
Returns the value of attribute educations.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def educations @educations end |
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def email @email end |
#external_resume_id ⇒ Object
Returns the value of attribute external_resume_id.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def external_resume_id @external_resume_id end |
#external_user_id ⇒ Object
Returns the value of attribute external_user_id.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def external_user_id @external_user_id end |
#gender ⇒ Object
Returns the value of attribute gender.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def gender @gender end |
#languages ⇒ Object
Returns the value of attribute languages.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def languages @languages end |
#modified_dt ⇒ Object
Returns the value of attribute modified_dt.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def modified_dt @modified_dt end |
#phone ⇒ Object
Returns the value of attribute phone.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def phone @phone end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def postal_code @postal_code end |
#real_name ⇒ Object
Returns the value of attribute real_name.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def real_name @real_name end |
#resume_text ⇒ Object
Returns the value of attribute resume_text.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def resume_text @resume_text end |
#show_contact_info ⇒ Object
Returns the value of attribute show_contact_info.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def show_contact_info @show_contact_info end |
#state ⇒ Object
Returns the value of attribute state.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def state @state end |
#test ⇒ Object
Returns the value of attribute test.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def test @test end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def title @title end |
#visibility ⇒ Object
Returns the value of attribute visibility.
3 4 5 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 3 def visibility @visibility end |
Instance Method Details
#add_company_experience(params) ⇒ Object
100 101 102 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 100 def add_company_experience(params) @company_experiences << CbResume::CbCompanyExperience.new(params) end |
#add_custom_value(params) ⇒ Object
112 113 114 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 112 def add_custom_value(params) @custom_values << CbResume::CbCustomValue.new(params) end |
#add_education(params) ⇒ Object
104 105 106 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 104 def add_education(params) @educations << CbResume::CbEducation.new(params) end |
#add_language(params) ⇒ Object
108 109 110 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 108 def add_language(params) @languages << CbResume::CbLanguage.new(params) end |
#certifications ⇒ Object
158 159 160 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 158 def certifications custom_value "CERTS" end |
#current_employed ⇒ Object
126 127 128 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 126 def current_employed custom_value "CURR_EMPLYD" end |
#custom_value(custom_value_key) ⇒ Object
116 117 118 119 120 121 122 123 124 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 116 def custom_value custom_value_key custom_value = "" @custom_values.each do |cv| custom_value = cv.value if cv.key == custom_value_key end return custom_value end |
#desired_job_type ⇒ Object
130 131 132 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 130 def desired_job_type custom_value "DES_JOB_TYP" end |
#experience_in_months ⇒ Object
134 135 136 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 134 def experience_in_months custom_value "EXP_MNS" end |
#it_skill ⇒ Object
154 155 156 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 154 def it_skill custom_value "IT_SKILLS" end |
#job_type ⇒ Object
138 139 140 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 138 def job_type custom_value "JOB_TYP" end |
#lang(id_lang) ⇒ Object
174 175 176 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 174 def lang(id_lang) custom_value "LANG" + id_lang end |
#lang_prof(id_lang) ⇒ Object
166 167 168 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 166 def lang_prof(id_lang) custom_value "LANG_PROF" + id_lang end |
#langs ⇒ Object
170 171 172 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 170 def langs custom_value "LANGS" end |
#load ⇒ Object
96 97 98 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 96 def load Cb.resume.retrieve self end |
#management_experience ⇒ Object
162 163 164 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 162 def management_experience custom_value "MGMT_EXP" end |
#recent_income ⇒ Object
142 143 144 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 142 def recent_income custom_value "RCNT_INCM" end |
#recent_income_currency_type ⇒ Object
146 147 148 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 146 def recent_income_currency_type custom_value "RCNT_INCM_CRCY_TYP" end |
#recent_income_type ⇒ Object
150 151 152 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 150 def recent_income_type custom_value "RCNT_INCM_TYP" end |
#set_attributes(args = {}) ⇒ Object
17 18 19 20 21 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 |
# File 'lib/cb/models/implementations/cb_resume.rb', line 17 def set_attributes(args = {}) return if args.nil? @did = args['ResumeDID'] || '' @email = args['Email'] || '' @real_name = args['RealName'] || '' @gender = args['Gender'] || '' @address = args['Address'] || '' @city = args['City'] || '' @state = args['State'] || '' @postal_code = args['PostalCode'] || '' @country_code = args['CountryCode'] || '' @phone = args['Phone'] || '' @birth_date = args['BirthDate'] || '' @title = args['Title'] || '' @visibility = args['Visibility'] || '' @show_contact_info = args['ShowContactInfo'] || '' @created_dt = args['CreatedDT'] || '' @modified_dt = args['ModifiedDT'] || '' @categories = args['Categories'] || '' @resume_text = args['ResumeText'] || '' @stats_searches = !args['Stats'].nil? ? args['Stats']['Searches'] : -1 @stats_clicks = !args['Stats'].nil? ? args['Stats']['Clicks'] : -1 @stats_applications = !args['Stats'].nil? ? args['Stats']['Applications'] : -1 #These don't come back on retrieve @external_resume_id = '' if @external_resume_id.blank? @external_user_id = '' if @external_user_id.blank? @test = false @company_experiences = [] if args.has_key?('CompanyExperiences') && !args['CompanyExperiences'].blank? ce = args['CompanyExperiences']['CompanyExperience'] if ce.is_a? Array ce.each do | hi | @company_experiences << CbResume::CbCompanyExperience.new(hi) end elsif ce.is_a? Hash @company_experiences << CbResume::CbCompanyExperience.new(ce) end end @educations = [] if args.has_key?('Educations') && !args['Educations'].blank? ed = args['Educations']['Education'] if ed.is_a? Array ed.each do | hello | @educations << CbResume::CbEducation.new(hello) end elsif ed.is_a? Hash @educations << CbResume::CbEducation.new(ed) end end @languages = [] if args.has_key?('Languages') && !args['Languages'].blank? la = args['Languages']['Language'] if la.is_a? Array la.each do | greetings | @languages << CbResume::CbLanguage.new(greetings) end elsif la.is_a? String @languages << CbResume::CbLanguage.new(la) end end @custom_values = [] if args.has_key?('CustomValues') && !args['CustomValues'].blank? cv = args['CustomValues']['CustomValue'] if cv.is_a? Array cv.each do | hola | @custom_values << CbResume::CbCustomValue.new(hola) end elsif cv.is_a? Hash @custom_values << CbResume::CbCustomValue.new(cv) end end end |