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

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

Overview

The list of the candidate’s professional experiences.

Instance Attribute Summary collapse

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

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

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

#format_for_display

Methods inherited from Mindee::V1::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)


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

def initialize(prediction, page_id)
  super
  @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)


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

def contract_type
  @contract_type
end

#departmentString (readonly)

The specific department or division within the company.

Returns:

  • (String)


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

def department
  @department
end

#descriptionString (readonly)

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

Returns:

  • (String)


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

def description
  @description
end

#employerString (readonly)

The name of the company or organization.

Returns:

  • (String)


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

def employer
  @employer
end

#end_monthString (readonly)

The month when the professional experience ended.

Returns:

  • (String)


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

def end_month
  @end_month
end

#end_yearString (readonly)

The year when the professional experience ended.

Returns:

  • (String)


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

def end_year
  @end_year
end

#roleString (readonly)

The position or job title held by the candidate.

Returns:

  • (String)


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

def role
  @role
end

#start_monthString (readonly)

The month when the professional experience began.

Returns:

  • (String)


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

def start_month
  @start_month
end

#start_yearString (readonly)

The year when the professional experience began.

Returns:

  • (String)


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

def start_year
  @start_year
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


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

def printable_values
  printable = {} # @type var printable: Hash[Symbol, String]
  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)


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

def table_printable_values
  printable = {} # @type var printable: Hash[Symbol, String]
  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)


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

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)


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

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