Class: Mindee::Product::FR::Payslip::PayslipV3Document

Inherits:
Mindee::Parsing::Common::Prediction show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/fr/payslip/payslip_v3_document.rb

Overview

Payslip API version 3.0 document data.

Direct Known Subclasses

PayslipV3PagePrediction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ PayslipV3Document

Returns a new instance of PayslipV3Document.

Parameters:

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


47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 47

def initialize(prediction, page_id)
  super()
  @bank_account_details = PayslipV3BankAccountDetail.new(prediction['bank_account_details'], page_id)
  @employee = PayslipV3Employee.new(prediction['employee'], page_id)
  @employer = PayslipV3Employer.new(prediction['employer'], page_id)
  @employment = PayslipV3Employment.new(prediction['employment'], page_id)
  @paid_time_off = []
  prediction['paid_time_off'].each do |item|
    @paid_time_off.push(PayslipV3PaidTimeOff.new(item, page_id))
  end
  @pay_detail = PayslipV3PayDetail.new(prediction['pay_detail'], page_id)
  @pay_period = PayslipV3PayPeriod.new(prediction['pay_period'], page_id)
  @salary_details = []
  prediction['salary_details'].each do |item|
    @salary_details.push(PayslipV3SalaryDetail.new(item, page_id))
  end
end

Instance Attribute Details

#bank_account_detailsMindee::Product::FR::Payslip::PayslipV3BankAccountDetail (readonly)

Information about the employee’s bank account.



22
23
24
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 22

def 
  @bank_account_details
end

#employeeMindee::Product::FR::Payslip::PayslipV3Employee (readonly)

Information about the employee.



25
26
27
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 25

def employee
  @employee
end

#employerMindee::Product::FR::Payslip::PayslipV3Employer (readonly)

Information about the employer.



28
29
30
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 28

def employer
  @employer
end

#employmentMindee::Product::FR::Payslip::PayslipV3Employment (readonly)

Information about the employment.



31
32
33
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 31

def employment
  @employment
end

Information about paid time off.



34
35
36
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 34

def paid_time_off
  @paid_time_off
end

#pay_detailMindee::Product::FR::Payslip::PayslipV3PayDetail (readonly)

Detailed information about the pay.



37
38
39
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 37

def pay_detail
  @pay_detail
end

#pay_periodMindee::Product::FR::Payslip::PayslipV3PayPeriod (readonly)

Information about the pay period.



40
41
42
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 40

def pay_period
  @pay_period
end

#salary_detailsArray<Mindee::Product::FR::Payslip::PayslipV3SalaryDetail> (readonly)

Detailed information about the earnings.



43
44
45
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 43

def salary_details
  @salary_details
end

Instance Method Details

#to_sString

Returns:

  • (String)


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/mindee/product/fr/payslip/payslip_v3_document.rb', line 66

def to_s
  pay_period = @pay_period.to_s
  employee = @employee.to_s
  employer = @employer.to_s
   = @bank_account_details.to_s
  employment = @employment.to_s
  salary_details = salary_details_to_s
  pay_detail = @pay_detail.to_s
  paid_time_off = paid_time_off_to_s
  out_str = String.new
  out_str << "\n:Pay Period:"
  out_str << pay_period
  out_str << "\n:Employee:"
  out_str << employee
  out_str << "\n:Employer:"
  out_str << employer
  out_str << "\n:Bank Account Details:"
  out_str << 
  out_str << "\n:Employment:"
  out_str << employment
  out_str << "\n:Salary Details:"
  out_str << salary_details
  out_str << "\n:Pay Detail:"
  out_str << pay_detail
  out_str << "\n:Paid Time Off:"
  out_str << paid_time_off
  out_str[1..].to_s
end