Class: Mindee::V2::Product::Crop::CropResult
- Inherits:
-
Object
- Object
- Mindee::V2::Product::Crop::CropResult
- Defined in:
- lib/mindee/v2/product/crop/crop_result.rb
Overview
Result of a crop utility inference.
Instance Attribute Summary collapse
-
#crops ⇒ Array<Cropitem>
readonly
List of results of cropped document regions.
Instance Method Summary collapse
-
#initialize(server_response) ⇒ CropResult
constructor
A new instance of CropResult.
-
#to_s ⇒ String
String representation.
Constructor Details
#initialize(server_response) ⇒ CropResult
Returns a new instance of CropResult.
15 16 17 18 19 20 21 |
# File 'lib/mindee/v2/product/crop/crop_result.rb', line 15 def initialize(server_response) @crops = if server_response.key?('crops') server_response['crops'].map do |crop| CropItem.new(crop) end end end |
Instance Attribute Details
#crops ⇒ Array<Cropitem> (readonly)
Returns List of results of cropped document regions.
12 13 14 |
# File 'lib/mindee/v2/product/crop/crop_result.rb', line 12 def crops @crops end |
Instance Method Details
#to_s ⇒ String
String representation.
25 26 27 28 29 |
# File 'lib/mindee/v2/product/crop/crop_result.rb', line 25 def to_s crops_str = @crops.join("\n") "Crops\n=====\n#{crops_str}" end |