Class: Mindee::Product::InvoiceSplitter::InvoiceSplitterV1InvoicePageGroup
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::InvoiceSplitter::InvoiceSplitterV1InvoicePageGroup
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb
Overview
List of page groups. Each group represents a single invoice within a multi-invoice document.
Instance Attribute Summary collapse
-
#page_indexes ⇒ Array<Integer>
readonly
List of page indexes that belong to the same invoice (group).
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ InvoiceSplitterV1InvoicePageGroup
constructor
A new instance of InvoiceSplitterV1InvoicePageGroup.
- #printable_values ⇒ Hash
- #table_printable_values ⇒ Hash
- #to_s ⇒ String
- #to_table_line ⇒ String
Methods inherited from Mindee::Parsing::Standard::FeatureField
Methods inherited from Mindee::Parsing::Standard::AbstractField
array_confidence, array_sum, float_to_string
Constructor Details
#initialize(prediction, page_id) ⇒ InvoiceSplitterV1InvoicePageGroup
Returns a new instance of InvoiceSplitterV1InvoicePageGroup.
17 18 19 20 21 |
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 17 def initialize(prediction, page_id) super @page_indexes = prediction['page_indexes'] @page_id = page_id end |
Instance Attribute Details
#page_indexes ⇒ Array<Integer> (readonly)
List of page indexes that belong to the same invoice (group).
13 14 15 |
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 13 def page_indexes @page_indexes end |
Instance Method Details
#printable_values ⇒ Hash
24 25 26 27 28 |
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 24 def printable_values printable = {} printable[:page_indexes] = format_for_display(@page_indexes) printable end |
#table_printable_values ⇒ Hash
31 32 33 34 35 |
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 31 def table_printable_values printable = {} printable[:page_indexes] = @page_indexes.join(', ') printable end |
#to_s ⇒ String
46 47 48 49 50 51 |
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 46 def to_s printable = printable_values out_str = String.new out_str << "\n :Page Indexes: #{printable[:page_indexes]}" out_str end |
#to_table_line ⇒ String
38 39 40 41 42 43 |
# File 'lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 38 def to_table_line printable = table_printable_values out_str = String.new out_str << format('| %- 73s', printable[:page_indexes]) out_str << '|' end |