Class: Mindee::Product::Resume::ResumeV1Education

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

Overview

The list of the candidate's educational background.

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) ⇒ ResumeV1Education

Returns a new instance of ResumeV1Education.

Parameters:

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


35
36
37
38
39
40
41
42
43
44
45
# File 'lib/mindee/product/resume/resume_v1_education.rb', line 35

def initialize(prediction, page_id)
  super(prediction, page_id)
  @degree_domain = prediction['degree_domain']
  @degree_type = prediction['degree_type']
  @end_month = prediction['end_month']
  @end_year = prediction['end_year']
  @school = prediction['school']
  @start_month = prediction['start_month']
  @start_year = prediction['start_year']
  @page_id = page_id
end

Instance Attribute Details

#degree_domainString (readonly)

The area of study or specialization.

Returns:

  • (String)


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

def degree_domain
  @degree_domain
end

#degree_typeString (readonly)

The type of degree obtained, such as Bachelor's, Master's, or Doctorate.

Returns:

  • (String)


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

def degree_type
  @degree_type
end

#end_monthString (readonly)

The month when the education program or course was completed.

Returns:

  • (String)


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

def end_month
  @end_month
end

#end_yearString (readonly)

The year when the education program or course was completed.

Returns:

  • (String)


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

def end_year
  @end_year
end

#schoolString (readonly)

The name of the school.

Returns:

  • (String)


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

def school
  @school
end

#start_monthString (readonly)

The month when the education program or course began.

Returns:

  • (String)


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

def start_month
  @start_month
end

#start_yearString (readonly)

The year when the education program or course began.

Returns:

  • (String)


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

def start_year
  @start_year
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


48
49
50
51
52
53
54
55
56
57
58
# File 'lib/mindee/product/resume/resume_v1_education.rb', line 48

def printable_values
  printable = {}
  printable[:degree_domain] = format_for_display(@degree_domain)
  printable[:degree_type] = format_for_display(@degree_type)
  printable[:end_month] = format_for_display(@end_month)
  printable[:end_year] = format_for_display(@end_year)
  printable[:school] = format_for_display(@school)
  printable[:start_month] = format_for_display(@start_month)
  printable[:start_year] = format_for_display(@start_year)
  printable
end

#table_printable_valuesHash

Returns:

  • (Hash)


61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mindee/product/resume/resume_v1_education.rb', line 61

def table_printable_values
  printable = {}
  printable[:degree_domain] = format_for_display(@degree_domain, 15)
  printable[:degree_type] = format_for_display(@degree_type, 25)
  printable[:end_month] = format_for_display(@end_month, nil)
  printable[:end_year] = format_for_display(@end_year, nil)
  printable[:school] = format_for_display(@school, 25)
  printable[:start_month] = format_for_display(@start_month, nil)
  printable[:start_year] = format_for_display(@start_year, nil)
  printable
end

#to_sString

Returns:

  • (String)


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

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Domain: #{printable[:degree_domain]}"
  out_str << "\n  :Degree: #{printable[:degree_type]}"
  out_str << "\n  :End Month: #{printable[:end_month]}"
  out_str << "\n  :End Year: #{printable[:end_year]}"
  out_str << "\n  :School: #{printable[:school]}"
  out_str << "\n  :Start Month: #{printable[:start_month]}"
  out_str << "\n  :Start Year: #{printable[:start_year]}"
  out_str
end

#to_table_lineString

Returns:

  • (String)


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

def to_table_line
  printable = table_printable_values
  out_str = String.new
  out_str << format('| %- 16s', printable[:degree_domain])
  out_str << format('| %- 26s', printable[:degree_type])
  out_str << format('| %- 10s', printable[:end_month])
  out_str << format('| %- 9s', printable[:end_year])
  out_str << format('| %- 26s', printable[:school])
  out_str << format('| %- 12s', printable[:start_month])
  out_str << format('| %- 11s', printable[:start_year])
  out_str << '|'
end