Class: Mindee::Product::FR::IdCard::IdCardV2PagePrediction

Inherits:
IdCardV2Document show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/fr/id_card/id_card_v2_page.rb

Overview

Carte Nationale d'Identité V2 page prediction.

Instance Attribute Summary collapse

Attributes inherited from IdCardV2Document

#alternate_name, #authority, #birth_date, #birth_place, #card_access_number, #document_number, #expiry_date, #gender, #given_names, #issue_date, #mrz1, #mrz2, #mrz3, #nationality, #surname

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ IdCardV2PagePrediction

Returns a new instance of IdCardV2PagePrediction.

Parameters:

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


35
36
37
38
39
# File 'lib/mindee/product/fr/id_card/id_card_v2_page.rb', line 35

def initialize(prediction, page_id)
  @document_side = ClassificationField.new(prediction['document_side'], page_id)
  @document_type = ClassificationField.new(prediction['document_type'], page_id)
  super(prediction, page_id)
end

Instance Attribute Details

#document_sideMindee::Parsing::Standard::ClassificationField (readonly)

The sides of the document which are visible.



28
29
30
# File 'lib/mindee/product/fr/id_card/id_card_v2_page.rb', line 28

def document_side
  @document_side
end

#document_typeMindee::Parsing::Standard::ClassificationField (readonly)

The document type or format.



31
32
33
# File 'lib/mindee/product/fr/id_card/id_card_v2_page.rb', line 31

def document_type
  @document_type
end

Instance Method Details

#to_sString

Returns:

  • (String)


42
43
44
45
46
47
48
# File 'lib/mindee/product/fr/id_card/id_card_v2_page.rb', line 42

def to_s
  out_str = String.new
  out_str << "\n:Document Type: #{@document_type}".rstrip
  out_str << "\n:Document Sides: #{@document_side}".rstrip
  out_str << "\n#{super}"
  out_str
end