Class: Mindee::Product::EU::LicensePlate::LicensePlateV1Document

Inherits:
Mindee::Parsing::Common::Prediction show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/eu/license_plate/license_plate_v1_document.rb

Overview

License Plate API version 1.1 document data.

Direct Known Subclasses

LicensePlateV1PagePrediction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ LicensePlateV1Document

Returns a new instance of LicensePlateV1Document.

Parameters:

  • prediction (Hash)
  • page_id (Integer, nil)


18
19
20
21
22
23
24
# File 'lib/mindee/product/eu/license_plate/license_plate_v1_document.rb', line 18

def initialize(prediction, page_id)
  super()
  @license_plates = []
  prediction['license_plates'].each do |item|
    @license_plates.push(StringField.new(item, page_id))
  end
end

Instance Attribute Details

#license_platesArray<Mindee::Parsing::Standard::StringField> (readonly)

List of all license plates found in the image.



14
15
16
# File 'lib/mindee/product/eu/license_plate/license_plate_v1_document.rb', line 14

def license_plates
  @license_plates
end

Instance Method Details

#to_sString

Returns:

  • (String)


27
28
29
30
31
32
# File 'lib/mindee/product/eu/license_plate/license_plate_v1_document.rb', line 27

def to_s
  license_plates = @license_plates.join("\n #{' ' * 16}")
  out_str = String.new
  out_str << "\n:License Plates: #{license_plates}".rstrip
  out_str[1..].to_s
end