Class: Mindee::V1::Product::Resume::ResumeV1Certificate
- Inherits:
-
Mindee::V1::Parsing::Standard::FeatureField
- Object
- Mindee::V1::Parsing::Standard::AbstractField
- Mindee::V1::Parsing::Standard::FeatureField
- Mindee::V1::Product::Resume::ResumeV1Certificate
- Includes:
- Mindee::V1::Parsing::Standard
- Defined in:
- lib/mindee/v1/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::V1::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::V1::Parsing::Standard::FeatureField
Methods inherited from Mindee::V1::Parsing::Standard::AbstractField
array_confidence, array_sum, float_to_string
Constructor Details
#initialize(prediction, page_id) ⇒ ResumeV1Certificate
Returns a new instance of ResumeV1Certificate.
28 29 30 31 32 33 34 35 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 28 def initialize(prediction, page_id) super @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.
15 16 17 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 15 def grade @grade end |
#name ⇒ String (readonly)
The name of certification.
18 19 20 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 18 def name @name end |
#provider ⇒ String (readonly)
The organization or institution that issued the certificate.
21 22 23 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 21 def provider @provider end |
#year ⇒ String (readonly)
The year when a certificate was issued or received.
24 25 26 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 24 def year @year end |
Instance Method Details
#printable_values ⇒ Hash
38 39 40 41 42 43 44 45 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 38 def printable_values printable = {} # @type var printable: Hash[Symbol, String] 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
48 49 50 51 52 53 54 55 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 48 def table_printable_values printable = {} # @type var printable: Hash[Symbol, String] 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
69 70 71 72 73 74 75 76 77 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 69 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
58 59 60 61 62 63 64 65 66 |
# File 'lib/mindee/v1/product/resume/resume_v1_certificate.rb', line 58 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 |