Class: Mindee::V1::Product::InvoiceSplitter::InvoiceSplitterV1InvoicePageGroup
- Inherits:
-
Mindee::V1::Parsing::Standard::FeatureField
- Object
- Mindee::V1::Parsing::Standard::AbstractField
- Mindee::V1::Parsing::Standard::FeatureField
- Mindee::V1::Product::InvoiceSplitter::InvoiceSplitterV1InvoicePageGroup
- Includes:
- Mindee::V1::Parsing::Standard
- Defined in:
- lib/mindee/v1/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::V1::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::V1::Parsing::Standard::FeatureField
Methods inherited from Mindee::V1::Parsing::Standard::AbstractField
array_confidence, array_sum, float_to_string
Constructor Details
#initialize(prediction, page_id) ⇒ InvoiceSplitterV1InvoicePageGroup
Returns a new instance of InvoiceSplitterV1InvoicePageGroup.
19 20 21 22 23 |
# File 'lib/mindee/v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 19 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).
15 16 17 |
# File 'lib/mindee/v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 15 def page_indexes @page_indexes end |
Instance Method Details
#printable_values ⇒ Hash
26 27 28 29 30 |
# File 'lib/mindee/v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 26 def printable_values printable = {} # @type var printable: Hash[Symbol, String] printable[:page_indexes] = format_for_display(@page_indexes) printable end |
#table_printable_values ⇒ Hash
33 34 35 36 37 |
# File 'lib/mindee/v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 33 def table_printable_values printable = {} # @type var printable: Hash[Symbol, String] printable[:page_indexes] = @page_indexes.join(', ') printable end |
#to_s ⇒ String
48 49 50 51 52 53 |
# File 'lib/mindee/v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 48 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
40 41 42 43 44 45 |
# File 'lib/mindee/v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb', line 40 def to_table_line printable = table_printable_values out_str = String.new out_str << format('| %- 73s', printable[:page_indexes]) out_str << '|' end |