Class: Mindee::Product::EU::DriverLicense::DriverLicenseV1PagePrediction

Inherits:
DriverLicenseV1Document show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/eu/driver_license/driver_license_v1_page.rb

Overview

Driver License V1 page prediction.

Instance Attribute Summary collapse

Attributes inherited from DriverLicenseV1Document

#address, #category, #country_code, #date_of_birth, #document_id, #expiry_date, #first_name, #issue_authority, #issue_date, #last_name, #mrz, #place_of_birth

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ DriverLicenseV1PagePrediction

Returns a new instance of DriverLicenseV1PagePrediction.

Parameters:

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


35
36
37
38
39
# File 'lib/mindee/product/eu/driver_license/driver_license_v1_page.rb', line 35

def initialize(prediction, page_id)
  @photo = PositionField.new(prediction['photo'], page_id)
  @signature = PositionField.new(prediction['signature'], page_id)
  super(prediction, page_id)
end

Instance Attribute Details

#photoMindee::Parsing::Standard::PositionField (readonly)

Has a photo of the EU driver license holder



28
29
30
# File 'lib/mindee/product/eu/driver_license/driver_license_v1_page.rb', line 28

def photo
  @photo
end

#signatureMindee::Parsing::Standard::PositionField (readonly)

Has a signature of the EU driver license holder



31
32
33
# File 'lib/mindee/product/eu/driver_license/driver_license_v1_page.rb', line 31

def signature
  @signature
end

Instance Method Details

#to_sString

Returns:

  • (String)


42
43
44
45
46
47
48
# File 'lib/mindee/product/eu/driver_license/driver_license_v1_page.rb', line 42

def to_s
  out_str = String.new
  out_str << "\n:Photo: #{@photo}".rstrip
  out_str << "\n:Signature: #{@signature}".rstrip
  out_str << "\n#{super}"
  out_str
end