Class: Cb::CbResume

Inherits:
Object
  • Object
show all
Defined in:
lib/cb/models/implementations/cb_resume.rb

Defined Under Namespace

Classes: CbCompanyExperience, CbCustomValue, CbEducation, CbLanguage

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addressObject

Returns the value of attribute address.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def address
  @address
end

#birth_dateObject

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

#categoriesObject

Returns the value of attribute categories.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def categories
  @categories
end

#cityObject

Returns the value of attribute city.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def city
  @city
end

#company_experiencesObject

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_codeObject

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_dtObject

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_valuesObject

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

#didObject

Returns the value of attribute did.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def did
  @did
end

#educationsObject

Returns the value of attribute educations.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def educations
  @educations
end

#emailObject

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_idObject

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_idObject

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

#genderObject

Returns the value of attribute gender.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def gender
  @gender
end

#languagesObject

Returns the value of attribute languages.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def languages
  @languages
end

#modified_dtObject

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

#phoneObject

Returns the value of attribute phone.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def phone
  @phone
end

#postal_codeObject

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_nameObject

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_textObject

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_infoObject

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

#stateObject

Returns the value of attribute state.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def state
  @state
end

#testObject

Returns the value of attribute test.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def test
  @test
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/cb/models/implementations/cb_resume.rb', line 3

def title
  @title
end

#visibilityObject

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

#certificationsObject



158
159
160
# File 'lib/cb/models/implementations/cb_resume.rb', line 158

def certifications
  custom_value "CERTS"
end

#current_employedObject



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_typeObject



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_monthsObject



134
135
136
# File 'lib/cb/models/implementations/cb_resume.rb', line 134

def experience_in_months
  custom_value "EXP_MNS"
end

#it_skillObject



154
155
156
# File 'lib/cb/models/implementations/cb_resume.rb', line 154

def it_skill
  custom_value "IT_SKILLS"
end

#job_typeObject



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

#langsObject



170
171
172
# File 'lib/cb/models/implementations/cb_resume.rb', line 170

def langs
  custom_value "LANGS"
end

#loadObject



96
97
98
# File 'lib/cb/models/implementations/cb_resume.rb', line 96

def load
  Cb.resume.retrieve self
end

#management_experienceObject



162
163
164
# File 'lib/cb/models/implementations/cb_resume.rb', line 162

def management_experience
  custom_value "MGMT_EXP"
end

#recent_incomeObject



142
143
144
# File 'lib/cb/models/implementations/cb_resume.rb', line 142

def recent_income
  custom_value "RCNT_INCM"
end

#recent_income_currency_typeObject



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_typeObject



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