Class: Mindee::Product::FR::Payslip::PayslipV2Pto
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::FR::Payslip::PayslipV2Pto
- 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
-
#accrued_this_period ⇒ Float
readonly
The amount of paid time off accrued in this period.
-
#balance_end_of_period ⇒ Float
readonly
The balance of paid time off at the end of the period.
-
#used_this_period ⇒ Float
readonly
The amount of paid time off used in this period.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ PayslipV2Pto
constructor
A new instance of PayslipV2Pto.
- #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) ⇒ PayslipV2Pto
Returns a new instance of PayslipV2Pto.
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_period ⇒ Float (readonly)
The amount of paid time off accrued in this period.
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_period ⇒ Float (readonly)
The balance of paid time off at the end of the period.
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_period ⇒ Float (readonly)
The amount of paid time off used in this period.
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_values ⇒ 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_s ⇒ 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 |