Class: Mindee::Product::InvoiceSplitter::InvoiceSplitterV1PageGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb

Overview

Page Group for Invoice Splitter class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction) ⇒ InvoiceSplitterV1PageGroup

Returns a new instance of InvoiceSplitterV1PageGroup.

Parameters:

  • prediction (Hash)


17
18
19
20
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb', line 17

def initialize(prediction)
  @page_indexes = prediction['page_indexes']
  @confidence = prediction['confidence'].nil? ? 0.0 : Float(prediction['confidence'])
end

Instance Attribute Details

#confidenceObject (readonly)

@return[Float, nil]



14
15
16
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb', line 14

def confidence
  @confidence
end

#page_indexesObject (readonly)

@return[Array]



11
12
13
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb', line 11

def page_indexes
  @page_indexes
end

Instance Method Details

#to_sString

Returns:

  • (String)


23
24
25
26
27
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb', line 23

def to_s
  out_str = String.new
  out_str << ":Page indexes: #{@page_indexes.join(', ')}"
  out_str
end