Class: Mindee::Product::FR::Payslip::PayslipV2Document
- Inherits:
-
Mindee::Parsing::Common::Prediction
- Object
- Mindee::Parsing::Common::Prediction
- Mindee::Product::FR::Payslip::PayslipV2Document
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/fr/payslip/payslip_v2_document.rb
Overview
Payslip API version 2.0 document data.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bank_account_details ⇒ Mindee::Product::FR::Payslip::PayslipV2BankAccountDetail
readonly
Information about the employee’s bank account.
-
#employee ⇒ Mindee::Product::FR::Payslip::PayslipV2Employee
readonly
Information about the employee.
-
#employer ⇒ Mindee::Product::FR::Payslip::PayslipV2Employer
readonly
Information about the employer.
-
#employment ⇒ Mindee::Product::FR::Payslip::PayslipV2Employment
readonly
Information about the employment.
-
#pay_detail ⇒ Mindee::Product::FR::Payslip::PayslipV2PayDetail
readonly
Detailed information about the pay.
-
#pay_period ⇒ Mindee::Product::FR::Payslip::PayslipV2PayPeriod
readonly
Information about the pay period.
-
#pto ⇒ Mindee::Product::FR::Payslip::PayslipV2Pto
readonly
Information about paid time off.
-
#salary_details ⇒ Array<Mindee::Product::FR::Payslip::PayslipV2SalaryDetail>
readonly
Detailed information about the earnings.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ PayslipV2Document
constructor
A new instance of PayslipV2Document.
- #to_s ⇒ String
Constructor Details
#initialize(prediction, page_id) ⇒ PayslipV2Document
Returns a new instance of PayslipV2Document.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 47 def initialize(prediction, page_id) super() @bank_account_details = PayslipV2BankAccountDetail.new(prediction['bank_account_details'], page_id) @employee = PayslipV2Employee.new(prediction['employee'], page_id) @employer = PayslipV2Employer.new(prediction['employer'], page_id) @employment = PayslipV2Employment.new(prediction['employment'], page_id) @pay_detail = PayslipV2PayDetail.new(prediction['pay_detail'], page_id) @pay_period = PayslipV2PayPeriod.new(prediction['pay_period'], page_id) @pto = PayslipV2Pto.new(prediction['pto'], page_id) @salary_details = [] prediction['salary_details'].each do |item| @salary_details.push(PayslipV2SalaryDetail.new(item, page_id)) end end |
Instance Attribute Details
#bank_account_details ⇒ Mindee::Product::FR::Payslip::PayslipV2BankAccountDetail (readonly)
Information about the employee’s bank account.
22 23 24 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 22 def bank_account_details @bank_account_details end |
#employee ⇒ Mindee::Product::FR::Payslip::PayslipV2Employee (readonly)
Information about the employee.
25 26 27 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 25 def employee @employee end |
#employer ⇒ Mindee::Product::FR::Payslip::PayslipV2Employer (readonly)
Information about the employer.
28 29 30 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 28 def employer @employer end |
#employment ⇒ Mindee::Product::FR::Payslip::PayslipV2Employment (readonly)
Information about the employment.
31 32 33 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 31 def employment @employment end |
#pay_detail ⇒ Mindee::Product::FR::Payslip::PayslipV2PayDetail (readonly)
Detailed information about the pay.
34 35 36 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 34 def pay_detail @pay_detail end |
#pay_period ⇒ Mindee::Product::FR::Payslip::PayslipV2PayPeriod (readonly)
Information about the pay period.
37 38 39 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 37 def pay_period @pay_period end |
#pto ⇒ Mindee::Product::FR::Payslip::PayslipV2Pto (readonly)
Information about paid time off.
40 41 42 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 40 def pto @pto end |
#salary_details ⇒ Array<Mindee::Product::FR::Payslip::PayslipV2SalaryDetail> (readonly)
Detailed information about the earnings.
43 44 45 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 43 def salary_details @salary_details end |
Instance Method Details
#to_s ⇒ String
63 64 65 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 |
# File 'lib/mindee/product/fr/payslip/payslip_v2_document.rb', line 63 def to_s employee = @employee.to_s employer = @employer.to_s bank_account_details = @bank_account_details.to_s employment = @employment.to_s salary_details = salary_details_to_s pay_detail = @pay_detail.to_s pto = @pto.to_s pay_period = @pay_period.to_s out_str = String.new out_str << "\n:Employee:" out_str << employee out_str << "\n:Employer:" out_str << employer out_str << "\n:Bank Account Details:" out_str << bank_account_details 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:PTO:" out_str << pto out_str << "\n:Pay Period:" out_str << pay_period out_str[1..].to_s end |