Class: Mindee::Product::Resume::ResumeV1Language
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::Resume::ResumeV1Language
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/resume/resume_v1_language.rb
Overview
The list of languages that the candidate is proficient in.
Instance Attribute Summary collapse
-
#language ⇒ String
readonly
The language’s ISO 639 code.
-
#level ⇒ String
readonly
The candidate’s level for the language.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ ResumeV1Language
constructor
A new instance of ResumeV1Language.
- #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) ⇒ ResumeV1Language
Returns a new instance of ResumeV1Language.
20 21 22 23 24 25 |
# File 'lib/mindee/product/resume/resume_v1_language.rb', line 20 def initialize(prediction, page_id) super(prediction, page_id) @language = prediction['language'] @level = prediction['level'] @page_id = page_id end |
Instance Attribute Details
#language ⇒ String (readonly)
The language’s ISO 639 code.
13 14 15 |
# File 'lib/mindee/product/resume/resume_v1_language.rb', line 13 def language @language end |
#level ⇒ String (readonly)
The candidate’s level for the language.
16 17 18 |
# File 'lib/mindee/product/resume/resume_v1_language.rb', line 16 def level @level end |
Instance Method Details
#printable_values ⇒ Hash
28 29 30 31 32 33 |
# File 'lib/mindee/product/resume/resume_v1_language.rb', line 28 def printable_values printable = {} printable[:language] = format_for_display(@language) printable[:level] = format_for_display(@level) printable end |
#table_printable_values ⇒ Hash
36 37 38 39 40 41 |
# File 'lib/mindee/product/resume/resume_v1_language.rb', line 36 def table_printable_values printable = {} printable[:language] = format_for_display(@language, nil) printable[:level] = format_for_display(@level, 20) printable end |
#to_s ⇒ String
53 54 55 56 57 58 59 |
# File 'lib/mindee/product/resume/resume_v1_language.rb', line 53 def to_s printable = printable_values out_str = String.new out_str << "\n :Language: #{printable[:language]}" out_str << "\n :Level: #{printable[:level]}" out_str end |
#to_table_line ⇒ String
44 45 46 47 48 49 50 |
# File 'lib/mindee/product/resume/resume_v1_language.rb', line 44 def to_table_line printable = table_printable_values out_str = String.new out_str << format('| %- 9s', printable[:language]) out_str << format('| %- 21s', printable[:level]) out_str << '|' end |