Class: Mindee::Product::Resume::ResumeV1ProfessionalExperience

Inherits:
Mindee::Parsing::Standard::FeatureField show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/resume/resume_v1_professional_experience.rb

Overview

The list of the candidate's professional experiences.

Instance Attribute Summary collapse

Attributes inherited from Mindee::Parsing::Standard::AbstractField

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

Methods inherited from Mindee::Parsing::Standard::FeatureField

#format_for_display

Methods inherited from Mindee::Parsing::Standard::AbstractField

array_confidence, array_sum, float_to_string

Constructor Details

#initialize(prediction, page_id) ⇒ ResumeV1ProfessionalExperience

Returns a new instance of ResumeV1ProfessionalExperience.

Parameters:

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


41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 41

def initialize(prediction, page_id)
  super(prediction, page_id)
  @contract_type = prediction['contract_type']
  @department = prediction['department']
  @description = prediction['description']
  @employer = prediction['employer']
  @end_month = prediction['end_month']
  @end_year = prediction['end_year']
  @role = prediction['role']
  @start_month = prediction['start_month']
  @start_year = prediction['start_year']
  @page_id = page_id
end

Instance Attribute Details

#contract_typeString (readonly)

The type of contract for the professional experience.

Returns:

  • (String)


13
14
15
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 13

def contract_type
  @contract_type
end

#departmentString (readonly)

The specific department or division within the company.

Returns:

  • (String)


16
17
18
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 16

def department
  @department
end

#descriptionString (readonly)

The description of the professional experience as written in the document.

Returns:

  • (String)


19
20
21
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 19

def description
  @description
end

#employerString (readonly)

The name of the company or organization.

Returns:

  • (String)


22
23
24
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 22

def employer
  @employer
end

#end_monthString (readonly)

The month when the professional experience ended.

Returns:

  • (String)


25
26
27
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 25

def end_month
  @end_month
end

#end_yearString (readonly)

The year when the professional experience ended.

Returns:

  • (String)


28
29
30
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 28

def end_year
  @end_year
end

#roleString (readonly)

The position or job title held by the candidate.

Returns:

  • (String)


31
32
33
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 31

def role
  @role
end

#start_monthString (readonly)

The month when the professional experience began.

Returns:

  • (String)


34
35
36
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 34

def start_month
  @start_month
end

#start_yearString (readonly)

The year when the professional experience began.

Returns:

  • (String)


37
38
39
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 37

def start_year
  @start_year
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 56

def printable_values
  printable = {}
  printable[:contract_type] = format_for_display(@contract_type)
  printable[:department] = format_for_display(@department)
  printable[:description] = format_for_display(@description)
  printable[:employer] = format_for_display(@employer)
  printable[:end_month] = format_for_display(@end_month)
  printable[:end_year] = format_for_display(@end_year)
  printable[:role] = format_for_display(@role)
  printable[:start_month] = format_for_display(@start_month)
  printable[:start_year] = format_for_display(@start_year)
  printable
end

#table_printable_valuesHash

Returns:

  • (Hash)


71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 71

def table_printable_values
  printable = {}
  printable[:contract_type] = format_for_display(@contract_type, 15)
  printable[:department] = format_for_display(@department, 10)
  printable[:description] = format_for_display(@description, 36)
  printable[:employer] = format_for_display(@employer, 25)
  printable[:end_month] = format_for_display(@end_month, nil)
  printable[:end_year] = format_for_display(@end_year, nil)
  printable[:role] = format_for_display(@role, 20)
  printable[:start_month] = format_for_display(@start_month, nil)
  printable[:start_year] = format_for_display(@start_year, nil)
  printable
end

#to_sString

Returns:

  • (String)


102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 102

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Contract Type: #{printable[:contract_type]}"
  out_str << "\n  :Department: #{printable[:department]}"
  out_str << "\n  :Description: #{printable[:description]}"
  out_str << "\n  :Employer: #{printable[:employer]}"
  out_str << "\n  :End Month: #{printable[:end_month]}"
  out_str << "\n  :End Year: #{printable[:end_year]}"
  out_str << "\n  :Role: #{printable[:role]}"
  out_str << "\n  :Start Month: #{printable[:start_month]}"
  out_str << "\n  :Start Year: #{printable[:start_year]}"
  out_str
end

#to_table_lineString

Returns:

  • (String)


86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/mindee/product/resume/resume_v1_professional_experience.rb', line 86

def to_table_line
  printable = table_printable_values
  out_str = String.new
  out_str << format('| %- 16s', printable[:contract_type])
  out_str << format('| %- 11s', printable[:department])
  out_str << format('| %- 37s', printable[:description])
  out_str << format('| %- 26s', printable[:employer])
  out_str << format('| %- 10s', printable[:end_month])
  out_str << format('| %- 9s', printable[:end_year])
  out_str << format('| %- 21s', printable[:role])
  out_str << format('| %- 12s', printable[:start_month])
  out_str << format('| %- 11s', printable[:start_year])
  out_str << '|'
end