Class: Mindee::Product::FR::Payslip::PayslipV3PaidTimeOff
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::FR::Payslip::PayslipV3PaidTimeOff
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb
Overview
Information about paid time off.
Instance Attribute Summary collapse
-
#accrued ⇒ Float
readonly
The amount of paid time off accrued in the period.
-
#period ⇒ String
readonly
The paid time off period.
-
#pto_type ⇒ String
readonly
The type of paid time off.
-
#remaining ⇒ Float
readonly
The remaining amount of paid time off at the end of the period.
-
#used ⇒ Float
readonly
The amount of paid time off used in the period.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ PayslipV3PaidTimeOff
constructor
A new instance of PayslipV3PaidTimeOff.
- #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) ⇒ PayslipV3PaidTimeOff
Returns a new instance of PayslipV3PaidTimeOff.
30 31 32 33 34 35 36 37 38 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 30 def initialize(prediction, page_id) super(prediction, page_id) @accrued = prediction['accrued'] @period = prediction['period'] @pto_type = prediction['pto_type'] @remaining = prediction['remaining'] @used = prediction['used'] @page_id = page_id end |
Instance Attribute Details
#accrued ⇒ Float (readonly)
The amount of paid time off accrued in the period.
14 15 16 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 14 def accrued @accrued end |
#period ⇒ String (readonly)
The paid time off period.
17 18 19 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 17 def period @period end |
#pto_type ⇒ String (readonly)
The type of paid time off.
20 21 22 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 20 def pto_type @pto_type end |
#remaining ⇒ Float (readonly)
The remaining amount of paid time off at the end of the period.
23 24 25 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 23 def remaining @remaining end |
#used ⇒ Float (readonly)
The amount of paid time off used in the period.
26 27 28 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 26 def used @used end |
Instance Method Details
#printable_values ⇒ Hash
41 42 43 44 45 46 47 48 49 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 41 def printable_values printable = {} printable[:accrued] = @accrued.nil? ? '' : Field.float_to_string(@accrued) printable[:period] = format_for_display(@period) printable[:pto_type] = format_for_display(@pto_type) printable[:remaining] = @remaining.nil? ? '' : Field.float_to_string(@remaining) printable[:used] = @used.nil? ? '' : Field.float_to_string(@used) printable end |
#table_printable_values ⇒ Hash
52 53 54 55 56 57 58 59 60 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 52 def table_printable_values printable = {} printable[:accrued] = @accrued.nil? ? '' : Field.float_to_string(@accrued) printable[:period] = format_for_display(@period, 6) printable[:pto_type] = format_for_display(@pto_type, 11) printable[:remaining] = @remaining.nil? ? '' : Field.float_to_string(@remaining) printable[:used] = @used.nil? ? '' : Field.float_to_string(@used) printable end |
#to_s ⇒ String
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 75 def to_s printable = printable_values out_str = String.new out_str << "\n :Accrued: #{printable[:accrued]}" out_str << "\n :Period: #{printable[:period]}" out_str << "\n :Type: #{printable[:pto_type]}" out_str << "\n :Remaining: #{printable[:remaining]}" out_str << "\n :Used: #{printable[:used]}" out_str end |
#to_table_line ⇒ String
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb', line 63 def to_table_line printable = table_printable_values out_str = String.new out_str << format('| %- 10s', printable[:accrued]) out_str << format('| %- 7s', printable[:period]) out_str << format('| %- 12s', printable[:pto_type]) out_str << format('| %- 10s', printable[:remaining]) out_str << format('| %- 10s', printable[:used]) out_str << '|' end |