Class: Mindee::Parsing::Standard::PaymentDetailsField

Inherits:
Field show all
Defined in:
lib/mindee/parsing/standard/payment_details_field.rb

Overview

Represents payment details for invoices and receipts

Instance Attribute Summary collapse

Attributes inherited from Field

#reconstructed, #value

Attributes inherited from AbstractField

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

Methods inherited from AbstractField

array_confidence, array_sum, float_to_string

Constructor Details

#initialize(prediction, page_id, reconstructed: false) ⇒ PaymentDetailsField

Returns a new instance of PaymentDetailsField.

Parameters:

  • prediction (Hash)
  • page_id (Integer, nil)
  • reconstructed (Boolean) (defaults to: false)


22
23
24
25
26
27
28
# File 'lib/mindee/parsing/standard/payment_details_field.rb', line 22

def initialize(prediction, page_id, reconstructed: false)
  super
  @account_number = prediction['account_number']
  @iban = prediction['iban']
  @routing_number = prediction['routing_number']
  @swift = prediction['swift']
end

Instance Attribute Details

#account_numberString? (readonly)

Returns:

  • (String, nil)


11
12
13
# File 'lib/mindee/parsing/standard/payment_details_field.rb', line 11

def 
  @account_number
end

#ibanString? (readonly)

Returns:

  • (String, nil)


13
14
15
# File 'lib/mindee/parsing/standard/payment_details_field.rb', line 13

def iban
  @iban
end

#routing_numberString? (readonly)

Returns:

  • (String, nil)


15
16
17
# File 'lib/mindee/parsing/standard/payment_details_field.rb', line 15

def routing_number
  @routing_number
end

#swiftString? (readonly)

Returns:

  • (String, nil)


17
18
19
# File 'lib/mindee/parsing/standard/payment_details_field.rb', line 17

def swift
  @swift
end

Instance Method Details

#to_sString

Returns:

  • (String)


31
32
33
34
35
36
37
38
# File 'lib/mindee/parsing/standard/payment_details_field.rb', line 31

def to_s
  out_str = String.new
  out_str << "#{@account_number}; " if @account_number
  out_str << "#{@iban}; " if @iban
  out_str << "#{@routing_number}; " if @routing_number
  out_str << "#{@swift}; " if @swift
  out_str.strip
end