Class: Mindee::Product::FR::Payslip::PayslipV2BankAccountDetail

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

Overview

Information about the employee's bank account.

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

Returns a new instance of PayslipV2BankAccountDetail.

Parameters:

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


24
25
26
27
28
29
30
# File 'lib/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rb', line 24

def initialize(prediction, page_id)
  super(prediction, page_id)
  @bank_name = prediction['bank_name']
  @iban = prediction['iban']
  @swift = prediction['swift']
  @page_id = page_id
end

Instance Attribute Details

#bank_nameString (readonly)

The name of the bank.

Returns:

  • (String)


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

def bank_name
  @bank_name
end

#ibanString (readonly)

The IBAN of the bank account.

Returns:

  • (String)


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

def iban
  @iban
end

#swiftString (readonly)

The SWIFT code of the bank.

Returns:

  • (String)


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

def swift
  @swift
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


33
34
35
36
37
38
39
# File 'lib/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rb', line 33

def printable_values
  printable = {}
  printable[:bank_name] = format_for_display(@bank_name)
  printable[:iban] = format_for_display(@iban)
  printable[:swift] = format_for_display(@swift)
  printable
end

#to_sString

Returns:

  • (String)


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

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Bank Name: #{printable[:bank_name]}"
  out_str << "\n  :IBAN: #{printable[:iban]}"
  out_str << "\n  :SWIFT: #{printable[:swift]}"
  out_str
end