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)


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

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

Instance Attribute Details

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

The sides of the document which are visible.



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

def document_side
  @document_side
end

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

The document type or format.



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

def document_type
  @document_type
end

Instance Method Details

#to_sString

Returns:

  • (String)


52
53
54
55
56
57
58
# File 'lib/mindee/product/fr/id_card/id_card_v2_page.rb', line 52

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