Class: Mindee::Product::FR::Payslip::PayslipV2Employment

Inherits:
Mindee::Parsing::Standard::FeatureField show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/fr/payslip/payslip_v2_employment.rb

Overview

Information about the employment.

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

Returns a new instance of PayslipV2Employment.

Parameters:

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


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

#categoryString (readonly)

The category of the employment.

Returns:

  • (String)


14
15
16
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 14

def category
  @category
end

#coefficientFloat (readonly)

The coefficient of the employment.

Returns:

  • (Float)


17
18
19
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 17

def coefficient
  @coefficient
end

#collective_agreementString (readonly)

The collective agreement of the employment.

Returns:

  • (String)


20
21
22
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 20

def collective_agreement
  @collective_agreement
end

#job_titleString (readonly)

The job title of the employee.

Returns:

  • (String)


23
24
25
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 23

def job_title
  @job_title
end

#position_levelString (readonly)

The position level of the employment.

Returns:

  • (String)


26
27
28
# File 'lib/mindee/product/fr/payslip/payslip_v2_employment.rb', line 26

def position_level
  @position_level
end

#start_dateString (readonly)

The start date of the employment.

Returns:

  • (String)


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_valuesHash

Returns:

  • (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_sString

Returns:

  • (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