Class: Mindee::Product::US::BankCheck::BankCheckV1PagePrediction

Inherits:
BankCheckV1Document show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/us/bank_check/bank_check_v1_page.rb

Overview

Bank Check V1 page prediction.

Instance Attribute Summary collapse

Attributes inherited from BankCheckV1Document

#account_number, #amount, #check_number, #date, #payees, #routing_number

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ BankCheckV1PagePrediction

Returns a new instance of BankCheckV1PagePrediction.

Parameters:

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


35
36
37
38
39
40
41
42
# File 'lib/mindee/product/us/bank_check/bank_check_v1_page.rb', line 35

def initialize(prediction, page_id)
  @check_position = PositionField.new(prediction['check_position'], page_id)
  @signatures_positions = []
  prediction['signatures_positions'].each do |item|
    @signatures_positions.push(PositionField.new(item, page_id))
  end
  super(prediction, page_id)
end

Instance Attribute Details

#check_positionMindee::Parsing::Standard::PositionField (readonly)

The position of the check on the document.



28
29
30
# File 'lib/mindee/product/us/bank_check/bank_check_v1_page.rb', line 28

def check_position
  @check_position
end

#signatures_positionsArray<Mindee::Parsing::Standard::PositionField> (readonly)

List of signature positions



31
32
33
# File 'lib/mindee/product/us/bank_check/bank_check_v1_page.rb', line 31

def signatures_positions
  @signatures_positions
end

Instance Method Details

#to_sString

Returns:

  • (String)


45
46
47
48
49
50
51
52
# File 'lib/mindee/product/us/bank_check/bank_check_v1_page.rb', line 45

def to_s
  signatures_positions = @signatures_positions.join("\n #{' ' * 21}")
  out_str = String.new
  out_str << "\n:Check Position: #{@check_position}".rstrip
  out_str << "\n:Signature Positions: #{signatures_positions}".rstrip
  out_str << "\n#{super}"
  out_str
end