Class: Mindee::Parsing::Common::Extras::CropperExtra
- Inherits:
-
Object
- Object
- Mindee::Parsing::Common::Extras::CropperExtra
- Defined in:
- lib/mindee/parsing/common/extras/cropper_extra.rb
Overview
Contains information on the cropping of a prediction.
Instance Attribute Summary collapse
-
#croppings ⇒ Array<Mindee::Parsing::Standard::PositionField>
readonly
Cropper extra initialization.
Instance Method Summary collapse
-
#initialize(raw_prediction, page_id = nil) ⇒ CropperExtra
constructor
A new instance of CropperExtra.
- #to_s ⇒ Object
Constructor Details
#initialize(raw_prediction, page_id = nil) ⇒ CropperExtra
Returns a new instance of CropperExtra.
15 16 17 18 19 20 |
# File 'lib/mindee/parsing/common/extras/cropper_extra.rb', line 15 def initialize(raw_prediction, page_id = nil) @croppings = [] raw_prediction['cropping']&.each do |crop| @croppings.push(Mindee::Parsing::Standard::PositionField.new(crop, page_id)) end end |
Instance Attribute Details
#croppings ⇒ Array<Mindee::Parsing::Standard::PositionField> (readonly)
Cropper extra initialization.
13 14 15 |
# File 'lib/mindee/parsing/common/extras/cropper_extra.rb', line 13 def croppings @croppings end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/mindee/parsing/common/extras/cropper_extra.rb', line 22 def to_s @croppings.map(&:to_s).join("\n ") end |