Class: Mindee::Product::FR::Payslip::PayslipV2PayPeriod

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

Overview

Information about the pay period.

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

Returns a new instance of PayslipV2PayPeriod.

Parameters:

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


30
31
32
33
34
35
36
37
38
# File 'lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb', line 30

def initialize(prediction, page_id)
  super(prediction, page_id)
  @end_date = prediction['end_date']
  @month = prediction['month']
  @payment_date = prediction['payment_date']
  @start_date = prediction['start_date']
  @year = prediction['year']
  @page_id = page_id
end

Instance Attribute Details

#end_dateString (readonly)

The end date of the pay period.

Returns:

  • (String)


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

def end_date
  @end_date
end

#monthString (readonly)

The month of the pay period.

Returns:

  • (String)


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

def month
  @month
end

#payment_dateString (readonly)

The date of payment for the pay period.

Returns:

  • (String)


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

def payment_date
  @payment_date
end

#start_dateString (readonly)

The start date of the pay period.

Returns:

  • (String)


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

def start_date
  @start_date
end

#yearString (readonly)

The year of the pay period.

Returns:

  • (String)


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

def year
  @year
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


41
42
43
44
45
46
47
48
49
# File 'lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb', line 41

def printable_values
  printable = {}
  printable[:end_date] = format_for_display(@end_date)
  printable[:month] = format_for_display(@month)
  printable[:payment_date] = format_for_display(@payment_date)
  printable[:start_date] = format_for_display(@start_date)
  printable[:year] = format_for_display(@year)
  printable
end

#to_sString

Returns:

  • (String)


52
53
54
55
56
57
58
59
60
61
# File 'lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb', line 52

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :End Date: #{printable[:end_date]}"
  out_str << "\n  :Month: #{printable[:month]}"
  out_str << "\n  :Payment Date: #{printable[:payment_date]}"
  out_str << "\n  :Start Date: #{printable[:start_date]}"
  out_str << "\n  :Year: #{printable[:year]}"
  out_str
end