Class: Mindee::Product::FR::Payslip::PayslipV2Pto

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

Overview

Information about paid time off.

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

Returns a new instance of PayslipV2Pto.

Parameters:

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


24
25
26
27
28
29
30
# File 'lib/mindee/product/fr/payslip/payslip_v2_pto.rb', line 24

def initialize(prediction, page_id)
  super(prediction, page_id)
  @accrued_this_period = prediction['accrued_this_period']
  @balance_end_of_period = prediction['balance_end_of_period']
  @used_this_period = prediction['used_this_period']
  @page_id = page_id
end

Instance Attribute Details

#accrued_this_periodFloat (readonly)

The amount of paid time off accrued in this period.

Returns:

  • (Float)


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

def accrued_this_period
  @accrued_this_period
end

#balance_end_of_periodFloat (readonly)

The balance of paid time off at the end of the period.

Returns:

  • (Float)


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

def balance_end_of_period
  @balance_end_of_period
end

#used_this_periodFloat (readonly)

The amount of paid time off used in this period.

Returns:

  • (Float)


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

def used_this_period
  @used_this_period
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


33
34
35
36
37
38
39
40
41
# File 'lib/mindee/product/fr/payslip/payslip_v2_pto.rb', line 33

def printable_values
  printable = {}
  printable[:accrued_this_period] =
    @accrued_this_period.nil? ? '' : Field.float_to_string(@accrued_this_period)
  printable[:balance_end_of_period] =
    @balance_end_of_period.nil? ? '' : Field.float_to_string(@balance_end_of_period)
  printable[:used_this_period] = @used_this_period.nil? ? '' : Field.float_to_string(@used_this_period)
  printable
end

#to_sString

Returns:

  • (String)


44
45
46
47
48
49
50
51
# File 'lib/mindee/product/fr/payslip/payslip_v2_pto.rb', line 44

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Accrued This Period: #{printable[:accrued_this_period]}"
  out_str << "\n  :Balance End of Period: #{printable[:balance_end_of_period]}"
  out_str << "\n  :Used This Period: #{printable[:used_this_period]}"
  out_str
end