Class: Cb::CbResume

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

Defined Under Namespace

Classes: CbCompanyExperience, CbCustomValue, CbEducation

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/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/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/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/cb_resume.rb', line 3

def categories
  @categories
end

#city ⇒ Object

Returns the value of attribute city.



3
4
5
# File 'lib/cb/models/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/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/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/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/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/cb_resume.rb', line 3

def did
  @did
end

#educations ⇒ Object

Returns the value of attribute educations.



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

def educations
  @educations
end

#email ⇒ Object

Returns the value of attribute email.



3
4
5
# File 'lib/cb/models/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/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/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/cb_resume.rb', line 3

def gender
  @gender
end

#languages ⇒ Object

Returns the value of attribute languages.



3
4
5
# File 'lib/cb/models/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/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/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/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/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/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/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/cb_resume.rb', line 3

def state
  @state
end

#test ⇒ Object

Returns the value of attribute test.



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

def test
  @test
end

#title ⇒ Object

Returns the value of attribute title.



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

def title
  @title
end

#visibility ⇒ Object

Returns the value of attribute visibility.



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

def visibility
  @visibility
end

Instance Method Details

#add_company_experience(params) ⇒ Object



80
81
82
# File 'lib/cb/models/cb_resume.rb', line 80

def add_company_experience(params)
  @company_experiences << CbResume::CbCompanyExperience.new(params)
end

#add_custom_value(params) ⇒ Object



88
89
90
# File 'lib/cb/models/cb_resume.rb', line 88

def add_custom_value(params)
  @custom_values << CbResume::CbCustomValue.new(params)
end

#add_education(params) ⇒ Object



84
85
86
# File 'lib/cb/models/cb_resume.rb', line 84

def add_education(params)
  @educations << CbResume::CbEducation.new(params)
end

#load ⇒ Object



76
77
78
# File 'lib/cb/models/cb_resume.rb', line 76

def load
  Cb.resume.retrieve self
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
# File 'lib/cb/models/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'] || ''
  @languages                = !args['Languages'].nil? ? args['Languages']['Language'] : ''
  @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')
    unless args['CompanyExperiences'].empty?
      args['CompanyExperiences']['CompanyExperience'].each do | qq |
        @company_experiences << CbResume::CbCompanyExperience.new(qq)
      end
    end
  end

  @educations = []
  if args.has_key?('Educations')
    unless args['Educations'].empty?
      args['Educations']['Education'].each do | qq |
        @educations << CbResume::CbEducation.new(qq)
      end
    end
  end

  @custom_values = []
  if args.has_key?('CustomValues')
    unless args['CustomValues'].empty?
      args['CustomValues']['CustomValue'].each do | qq |
        @custom_values << CbResume::CbCustomValue.new(qq)
      end
    end
  end
end