Class: Mindee::Product::Cropper::CropperV1PagePrediction
- Inherits:
-
CropperV1Document
- Object
- Mindee::Parsing::Common::Prediction
- CropperV1Document
- Mindee::Product::Cropper::CropperV1PagePrediction
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/cropper/cropper_v1_page.rb
Overview
Cropper V1 page prediction.
Instance Attribute Summary collapse
-
#cropping ⇒ Array<Mindee::Parsing::Standard::PositionField>
readonly
List of documents found in the image.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ CropperV1PagePrediction
constructor
A new instance of CropperV1PagePrediction.
- #to_s ⇒ String
Constructor Details
#initialize(prediction, page_id) ⇒ CropperV1PagePrediction
Returns a new instance of CropperV1PagePrediction.
31 32 33 34 35 36 37 |
# File 'lib/mindee/product/cropper/cropper_v1_page.rb', line 31 def initialize(prediction, page_id) @cropping = [] prediction['cropping'].each do |item| @cropping.push(PositionField.new(item, page_id)) end super() end |
Instance Attribute Details
#cropping ⇒ Array<Mindee::Parsing::Standard::PositionField> (readonly)
List of documents found in the image.
27 28 29 |
# File 'lib/mindee/product/cropper/cropper_v1_page.rb', line 27 def cropping @cropping end |
Instance Method Details
#to_s ⇒ String
40 41 42 43 44 45 |
# File 'lib/mindee/product/cropper/cropper_v1_page.rb', line 40 def to_s cropping = @cropping.join("\n #{' ' * 18}") out_str = String.new out_str << "\n:Document Cropper: #{cropping}".rstrip out_str end |