Class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2Document

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

Overview

Bank Account Details API version 2.0 document data.

Direct Known Subclasses

BankAccountDetailsV2PagePrediction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ BankAccountDetailsV2Document

Returns a new instance of BankAccountDetailsV2Document.

Parameters:

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


28
29
30
31
32
33
34
# File 'lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb', line 28

def initialize(prediction, page_id)
  super()
  @account_holders_names = StringField.new(prediction['account_holders_names'], page_id)
  @bban = BankAccountDetailsV2Bban.new(prediction['bban'], page_id)
  @iban = StringField.new(prediction['iban'], page_id)
  @swift_code = StringField.new(prediction['swift_code'], page_id)
end

Instance Attribute Details

#account_holders_namesMindee::Parsing::Standard::StringField (readonly)

Full extraction of the account holders names.



15
16
17
# File 'lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb', line 15

def 
  @account_holders_names
end

#bbanMindee::Product::FR::BankAccountDetails::BankAccountDetailsV2Bban (readonly)

Full extraction of BBAN, including: branch code, bank code, account and key.



18
19
20
# File 'lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb', line 18

def bban
  @bban
end

#ibanMindee::Parsing::Standard::StringField (readonly)

Full extraction of the IBAN number.



21
22
23
# File 'lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb', line 21

def iban
  @iban
end

#swift_codeMindee::Parsing::Standard::StringField (readonly)

Full extraction of the SWIFT code.



24
25
26
# File 'lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb', line 24

def swift_code
  @swift_code
end

Instance Method Details

#to_sString

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
# File 'lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb', line 37

def to_s
  bban = @bban.to_s
  out_str = String.new
  out_str << "\n:Account Holder's Names: #{@account_holders_names}".rstrip
  out_str << "\n:Basic Bank Account Number:"
  out_str << bban
  out_str << "\n:IBAN: #{@iban}".rstrip
  out_str << "\n:SWIFT Code: #{@swift_code}".rstrip
  out_str[1..].to_s
end