Class: Mindee::Product::MultiReceiptsDetector::MultiReceiptsDetectorV1Document
- Inherits:
-
Mindee::Parsing::Common::Prediction
- Object
- Mindee::Parsing::Common::Prediction
- Mindee::Product::MultiReceiptsDetector::MultiReceiptsDetectorV1Document
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb
Overview
Multi Receipts Detector API version 1.1 document data.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#receipts ⇒ Array<Mindee::Parsing::Standard::PositionField>
readonly
Positions of the receipts on the document.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ MultiReceiptsDetectorV1Document
constructor
A new instance of MultiReceiptsDetectorV1Document.
- #to_s ⇒ String
Constructor Details
#initialize(prediction, page_id) ⇒ MultiReceiptsDetectorV1Document
Returns a new instance of MultiReceiptsDetectorV1Document.
17 18 19 20 21 22 23 |
# File 'lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb', line 17 def initialize(prediction, page_id) super() @receipts = [] prediction['receipts'].each do |item| @receipts.push(PositionField.new(item, page_id)) end end |
Instance Attribute Details
#receipts ⇒ Array<Mindee::Parsing::Standard::PositionField> (readonly)
Positions of the receipts on the document.
13 14 15 |
# File 'lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb', line 13 def receipts @receipts end |
Instance Method Details
#to_s ⇒ String
26 27 28 29 30 31 |
# File 'lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb', line 26 def to_s receipts = @receipts.join("\n #{' ' * 18}") out_str = String.new out_str << "\n:List of Receipts: #{receipts}".rstrip out_str[1..].to_s end |