Class: Mindee::Product::FR::CarteVitale::CarteVitaleV1Document
- Inherits:
-
Mindee::Parsing::Common::Prediction
- Object
- Mindee::Parsing::Common::Prediction
- Mindee::Product::FR::CarteVitale::CarteVitaleV1Document
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/fr/carte_vitale/carte_vitale_v1_document.rb
Overview
Carte Vitale API version 1.1 document data.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#given_names ⇒ Array<Mindee::Parsing::Standard::StringField>
readonly
The given name(s) of the card holder.
-
#issuance_date ⇒ Mindee::Parsing::Standard::DateField
readonly
The date the card was issued.
-
#social_security ⇒ Mindee::Parsing::Standard::StringField
readonly
The Social Security Number (Numéro de Sécurité Sociale) of the card holder.
-
#surname ⇒ Mindee::Parsing::Standard::StringField
readonly
The surname of the card holder.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ CarteVitaleV1Document
constructor
A new instance of CarteVitaleV1Document.
- #to_s ⇒ String
Constructor Details
#initialize(prediction, page_id) ⇒ CarteVitaleV1Document
Returns a new instance of CarteVitaleV1Document.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/mindee/product/fr/carte_vitale/carte_vitale_v1_document.rb', line 27 def initialize(prediction, page_id) super() @given_names = [] prediction['given_names'].each do |item| @given_names.push(StringField.new(item, page_id)) end @issuance_date = DateField.new(prediction['issuance_date'], page_id) @social_security = StringField.new(prediction['social_security'], page_id) @surname = StringField.new(prediction['surname'], page_id) end |
Instance Attribute Details
#given_names ⇒ Array<Mindee::Parsing::Standard::StringField> (readonly)
The given name(s) of the card holder.
14 15 16 |
# File 'lib/mindee/product/fr/carte_vitale/carte_vitale_v1_document.rb', line 14 def given_names @given_names end |
#issuance_date ⇒ Mindee::Parsing::Standard::DateField (readonly)
The date the card was issued.
17 18 19 |
# File 'lib/mindee/product/fr/carte_vitale/carte_vitale_v1_document.rb', line 17 def issuance_date @issuance_date end |
#social_security ⇒ Mindee::Parsing::Standard::StringField (readonly)
The Social Security Number (Numéro de Sécurité Sociale) of the card holder
20 21 22 |
# File 'lib/mindee/product/fr/carte_vitale/carte_vitale_v1_document.rb', line 20 def @social_security end |
#surname ⇒ Mindee::Parsing::Standard::StringField (readonly)
The surname of the card holder.
23 24 25 |
# File 'lib/mindee/product/fr/carte_vitale/carte_vitale_v1_document.rb', line 23 def surname @surname end |
Instance Method Details
#to_s ⇒ String
39 40 41 42 43 44 45 46 47 |
# File 'lib/mindee/product/fr/carte_vitale/carte_vitale_v1_document.rb', line 39 def to_s given_names = @given_names.join("\n #{' ' * 15}") out_str = String.new out_str << "\n:Given Name(s): #{given_names}".rstrip out_str << "\n:Surname: #{@surname}".rstrip out_str << "\n:Social Security Number: #{@social_security}".rstrip out_str << "\n:Issuance Date: #{@issuance_date}".rstrip out_str[1..].to_s end |