Class: Mindee::Product::FR::Payslip::PayslipV2Employment
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::FR::Payslip::PayslipV2Employment
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/fr/payslip/payslip_v2_employment.rb
Overview
Information about the employment.
Instance Attribute Summary collapse
-
#category ⇒ String
readonly
The category of the employment.
-
#coefficient ⇒ Float
readonly
The coefficient of the employment.
-
#collective_agreement ⇒ String
readonly
The collective agreement of the employment.
-
#job_title ⇒ String
readonly
The job title of the employee.
-
#position_level ⇒ String
readonly
The position level of the employment.
-
#start_date ⇒ String
readonly
The start date of the employment.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ PayslipV2Employment
constructor
A new instance of PayslipV2Employment.
- #printable_values ⇒ Hash
- #to_s ⇒ 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) ⇒ PayslipV2Employment
Returns a new instance of PayslipV2Employment.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 33 def initialize(prediction, page_id) super(prediction, page_id) @category = prediction['category'] @coefficient = prediction['coefficient'] @collective_agreement = prediction['collective_agreement'] @job_title = prediction['job_title'] @position_level = prediction['position_level'] @start_date = prediction['start_date'] @page_id = page_id end |
Instance Attribute Details
#category ⇒ String (readonly)
The category of the employment.
14 15 16 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 14 def category @category end |
#coefficient ⇒ Float (readonly)
The coefficient of the employment.
17 18 19 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 17 def coefficient @coefficient end |
#collective_agreement ⇒ String (readonly)
The collective agreement of the employment.
20 21 22 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 20 def collective_agreement @collective_agreement end |
#job_title ⇒ String (readonly)
The job title of the employee.
23 24 25 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 23 def job_title @job_title end |
#position_level ⇒ String (readonly)
The position level of the employment.
26 27 28 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 26 def position_level @position_level end |
#start_date ⇒ String (readonly)
The start date of the employment.
29 30 31 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 29 def start_date @start_date end |
Instance Method Details
#printable_values ⇒ Hash
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 45 def printable_values printable = {} printable[:category] = format_for_display(@category) printable[:coefficient] = @coefficient.nil? ? '' : Field.float_to_string(@coefficient) printable[:collective_agreement] = format_for_display(@collective_agreement) printable[:job_title] = format_for_display(@job_title) printable[:position_level] = format_for_display(@position_level) printable[:start_date] = format_for_display(@start_date) printable end |
#to_s ⇒ String
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 57 def to_s printable = printable_values out_str = String.new out_str << "\n :Category: #{printable[:category]}" out_str << "\n :Coefficient: #{printable[:coefficient]}" out_str << "\n :Collective Agreement: #{printable[:collective_agreement]}" out_str << "\n :Job Title: #{printable[:job_title]}" out_str << "\n :Position Level: #{printable[:position_level]}" out_str << "\n :Start Date: #{printable[:start_date]}" out_str end |