Class: Mindee::Product::Resume::ResumeV1Document

Inherits:
Mindee::Parsing::Common::Prediction show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/resume/resume_v1_document.rb

Overview

Resume API version 1.1 document data.

Direct Known Subclasses

ResumeV1PagePrediction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ ResumeV1Document

Returns a new instance of ResumeV1Document.

Parameters:

  • prediction (Hash)
  • page_id (Integer, nil)


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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 70

def initialize(prediction, page_id)
  super()
  @address = StringField.new(prediction['address'], page_id)
  @certificates = []
  prediction['certificates'].each do |item|
    @certificates.push(ResumeV1Certificate.new(item, page_id))
  end
  @document_language = StringField.new(prediction['document_language'], page_id)
  @document_type = ClassificationField.new(prediction['document_type'], page_id)
  @education = []
  prediction['education'].each do |item|
    @education.push(ResumeV1Education.new(item, page_id))
  end
  @email_address = StringField.new(prediction['email_address'], page_id)
  @given_names = []
  prediction['given_names'].each do |item|
    @given_names.push(StringField.new(item, page_id))
  end
  @hard_skills = []
  prediction['hard_skills'].each do |item|
    @hard_skills.push(StringField.new(item, page_id))
  end
  @job_applied = StringField.new(prediction['job_applied'], page_id)
  @languages = []
  prediction['languages'].each do |item|
    @languages.push(ResumeV1Language.new(item, page_id))
  end
  @nationality = StringField.new(prediction['nationality'], page_id)
  @phone_number = StringField.new(prediction['phone_number'], page_id)
  @profession = StringField.new(prediction['profession'], page_id)
  @professional_experiences = []
  prediction['professional_experiences'].each do |item|
    @professional_experiences.push(ResumeV1ProfessionalExperience.new(item, page_id))
  end
  @social_networks_urls = []
  prediction['social_networks_urls'].each do |item|
    @social_networks_urls.push(ResumeV1SocialNetworksUrl.new(item, page_id))
  end
  @soft_skills = []
  prediction['soft_skills'].each do |item|
    @soft_skills.push(StringField.new(item, page_id))
  end
  @surnames = []
  prediction['surnames'].each do |item|
    @surnames.push(StringField.new(item, page_id))
  end
end

Instance Attribute Details

#addressMindee::Parsing::Standard::StringField (readonly)

The location information of the candidate, including city, state, and country.



18
19
20
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 18

def address
  @address
end

#certificatesArray<Mindee::Product::Resume::ResumeV1Certificate> (readonly)

The list of certificates obtained by the candidate.



21
22
23
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 21

def certificates
  @certificates
end

#document_languageMindee::Parsing::Standard::StringField (readonly)

The ISO 639 code of the language in which the document is written.



24
25
26
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 24

def document_language
  @document_language
end

#document_typeMindee::Parsing::Standard::ClassificationField (readonly)

The type of the document sent.



27
28
29
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 27

def document_type
  @document_type
end

#educationArray<Mindee::Product::Resume::ResumeV1Education> (readonly)

The list of the candidate's educational background.



30
31
32
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 30

def education
  @education
end

#email_addressMindee::Parsing::Standard::StringField (readonly)

The email address of the candidate.



33
34
35
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 33

def email_address
  @email_address
end

#given_namesArray<Mindee::Parsing::Standard::StringField> (readonly)

The candidate's first or given names.



36
37
38
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 36

def given_names
  @given_names
end

#hard_skillsArray<Mindee::Parsing::Standard::StringField> (readonly)

The list of the candidate's technical abilities and knowledge.



39
40
41
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 39

def hard_skills
  @hard_skills
end

#job_appliedMindee::Parsing::Standard::StringField (readonly)

The position that the candidate is applying for.



42
43
44
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 42

def job_applied
  @job_applied
end

#languagesArray<Mindee::Product::Resume::ResumeV1Language> (readonly)

The list of languages that the candidate is proficient in.



45
46
47
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 45

def languages
  @languages
end

#nationalityMindee::Parsing::Standard::StringField (readonly)

The ISO 3166 code for the country of citizenship of the candidate.



48
49
50
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 48

def nationality
  @nationality
end

#phone_numberMindee::Parsing::Standard::StringField (readonly)

The phone number of the candidate.



51
52
53
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 51

def phone_number
  @phone_number
end

#professionMindee::Parsing::Standard::StringField (readonly)

The candidate's current profession.



54
55
56
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 54

def profession
  @profession
end

#professional_experiencesArray<Mindee::Product::Resume::ResumeV1ProfessionalExperience> (readonly)

The list of the candidate's professional experiences.



57
58
59
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 57

def professional_experiences
  @professional_experiences
end

#social_networks_urlsArray<Mindee::Product::Resume::ResumeV1SocialNetworksUrl> (readonly)

The list of social network profiles of the candidate.



60
61
62
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 60

def social_networks_urls
  @social_networks_urls
end

#soft_skillsArray<Mindee::Parsing::Standard::StringField> (readonly)

The list of the candidate's interpersonal and communication abilities.



63
64
65
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 63

def soft_skills
  @soft_skills
end

#surnamesArray<Mindee::Parsing::Standard::StringField> (readonly)

The candidate's last names.



66
67
68
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 66

def surnames
  @surnames
end

Instance Method Details

#to_sString

Returns:

  • (String)


119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/mindee/product/resume/resume_v1_document.rb', line 119

def to_s
  given_names = @given_names.join("\n #{' ' * 13}")
  surnames = @surnames.join("\n #{' ' * 10}")
  social_networks_urls = social_networks_urls_to_s
  languages = languages_to_s
  hard_skills = @hard_skills.join("\n #{' ' * 13}")
  soft_skills = @soft_skills.join("\n #{' ' * 13}")
  education = education_to_s
  professional_experiences = professional_experiences_to_s
  certificates = certificates_to_s
  out_str = String.new
  out_str << "\n:Document Language: #{@document_language}".rstrip
  out_str << "\n:Document Type: #{@document_type}".rstrip
  out_str << "\n:Given Names: #{given_names}".rstrip
  out_str << "\n:Surnames: #{surnames}".rstrip
  out_str << "\n:Nationality: #{@nationality}".rstrip
  out_str << "\n:Email Address: #{@email_address}".rstrip
  out_str << "\n:Phone Number: #{@phone_number}".rstrip
  out_str << "\n:Address: #{@address}".rstrip
  out_str << "\n:Social Networks:"
  out_str << social_networks_urls
  out_str << "\n:Profession: #{@profession}".rstrip
  out_str << "\n:Job Applied: #{@job_applied}".rstrip
  out_str << "\n:Languages:"
  out_str << languages
  out_str << "\n:Hard Skills: #{hard_skills}".rstrip
  out_str << "\n:Soft Skills: #{soft_skills}".rstrip
  out_str << "\n:Education:"
  out_str << education
  out_str << "\n:Professional Experiences:"
  out_str << professional_experiences
  out_str << "\n:Certificates:"
  out_str << certificates
  out_str[1..].to_s
end