Class: Mindee::Product::Resume::ResumeV1Certificate
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::Resume::ResumeV1Certificate
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/resume/resume_v1_certificate.rb
Overview
The list of certificates obtained by the candidate.
Instance Attribute Summary collapse
-
#grade ⇒ String
readonly
The grade obtained for the certificate.
-
#name ⇒ String
readonly
The name of certification.
-
#provider ⇒ String
readonly
The organization or institution that issued the certificate.
-
#year ⇒ String
readonly
The year when a certificate was issued or received.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ ResumeV1Certificate
constructor
A new instance of ResumeV1Certificate.
- #printable_values ⇒ Hash
- #table_printable_values ⇒ Hash
- #to_s ⇒ String
- #to_table_line ⇒ String
Methods inherited from Mindee::Parsing::Standard::FeatureField
Methods inherited from Mindee::Parsing::Standard::AbstractField
array_confidence, array_sum, float_to_string
Constructor Details
#initialize(prediction, page_id) ⇒ ResumeV1Certificate
Returns a new instance of ResumeV1Certificate.
26 27 28 29 30 31 32 33 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 26 def initialize(prediction, page_id) super(prediction, page_id) @grade = prediction['grade'] @name = prediction['name'] @provider = prediction['provider'] @year = prediction['year'] @page_id = page_id end |
Instance Attribute Details
#grade ⇒ String (readonly)
The grade obtained for the certificate.
13 14 15 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 13 def grade @grade end |
#name ⇒ String (readonly)
The name of certification.
16 17 18 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 16 def name @name end |
#provider ⇒ String (readonly)
The organization or institution that issued the certificate.
19 20 21 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 19 def provider @provider end |
#year ⇒ String (readonly)
The year when a certificate was issued or received.
22 23 24 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 22 def year @year end |
Instance Method Details
#printable_values ⇒ Hash
36 37 38 39 40 41 42 43 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 36 def printable_values printable = {} printable[:grade] = format_for_display(@grade) printable[:name] = format_for_display(@name) printable[:provider] = format_for_display(@provider) printable[:year] = format_for_display(@year) printable end |
#table_printable_values ⇒ Hash
46 47 48 49 50 51 52 53 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 46 def table_printable_values printable = {} printable[:grade] = format_for_display(@grade, 10) printable[:name] = format_for_display(@name, 30) printable[:provider] = format_for_display(@provider, 25) printable[:year] = format_for_display(@year, nil) printable end |
#to_s ⇒ String
67 68 69 70 71 72 73 74 75 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 67 def to_s printable = printable_values out_str = String.new out_str << "\n :Grade: #{printable[:grade]}" out_str << "\n :Name: #{printable[:name]}" out_str << "\n :Provider: #{printable[:provider]}" out_str << "\n :Year: #{printable[:year]}" out_str end |
#to_table_line ⇒ String
56 57 58 59 60 61 62 63 64 |
# File 'lib/mindee/product/resume/resume_v1_certificate.rb', line 56 def to_table_line printable = table_printable_values out_str = String.new out_str << format('| %- 11s', printable[:grade]) out_str << format('| %- 31s', printable[:name]) out_str << format('| %- 26s', printable[:provider]) out_str << format('| %- 5s', printable[:year]) out_str << '|' end |