Class: Mindee::Product::FR::CarteGrise::CarteGriseV1Document

Inherits:
Mindee::Parsing::Common::Prediction show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb

Overview

Carte Grise API version 1.1 document data.

Direct Known Subclasses

CarteGriseV1PagePrediction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ CarteGriseV1Document

Returns a new instance of CarteGriseV1Document.

Parameters:

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


138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 138

def initialize(prediction, page_id)
  super()
  @a = StringField.new(prediction['a'], page_id)
  @b = DateField.new(prediction['b'], page_id)
  @c1 = StringField.new(prediction['c1'], page_id)
  @c3 = StringField.new(prediction['c3'], page_id)
  @c41 = StringField.new(prediction['c41'], page_id)
  @c4a = StringField.new(prediction['c4a'], page_id)
  @d1 = StringField.new(prediction['d1'], page_id)
  @d3 = StringField.new(prediction['d3'], page_id)
  @e = StringField.new(prediction['e'], page_id)
  @f1 = StringField.new(prediction['f1'], page_id)
  @f2 = StringField.new(prediction['f2'], page_id)
  @f3 = StringField.new(prediction['f3'], page_id)
  @formula_number = StringField.new(prediction['formula_number'], page_id)
  @g = StringField.new(prediction['g'], page_id)
  @g1 = StringField.new(prediction['g1'], page_id)
  @i = DateField.new(prediction['i'], page_id)
  @j = StringField.new(prediction['j'], page_id)
  @j1 = StringField.new(prediction['j1'], page_id)
  @j2 = StringField.new(prediction['j2'], page_id)
  @j3 = StringField.new(prediction['j3'], page_id)
  @mrz1 = StringField.new(prediction['mrz1'], page_id)
  @mrz2 = StringField.new(prediction['mrz2'], page_id)
  @owner_first_name = StringField.new(prediction['owner_first_name'], page_id)
  @owner_surname = StringField.new(prediction['owner_surname'], page_id)
  @p1 = StringField.new(prediction['p1'], page_id)
  @p2 = StringField.new(prediction['p2'], page_id)
  @p3 = StringField.new(prediction['p3'], page_id)
  @p6 = StringField.new(prediction['p6'], page_id)
  @q = StringField.new(prediction['q'], page_id)
  @s1 = StringField.new(prediction['s1'], page_id)
  @s2 = StringField.new(prediction['s2'], page_id)
  @u1 = StringField.new(prediction['u1'], page_id)
  @u2 = StringField.new(prediction['u2'], page_id)
  @v7 = StringField.new(prediction['v7'], page_id)
  @x1 = StringField.new(prediction['x1'], page_id)
  @y1 = StringField.new(prediction['y1'], page_id)
  @y2 = StringField.new(prediction['y2'], page_id)
  @y3 = StringField.new(prediction['y3'], page_id)
  @y4 = StringField.new(prediction['y4'], page_id)
  @y5 = StringField.new(prediction['y5'], page_id)
  @y6 = StringField.new(prediction['y6'], page_id)
end

Instance Attribute Details

#aMindee::Parsing::Standard::StringField (readonly)

The vehicle's license plate number.



14
15
16
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 14

def a
  @a
end

#bMindee::Parsing::Standard::DateField (readonly)

The vehicle's first release date.



17
18
19
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 17

def b
  @b
end

#c1Mindee::Parsing::Standard::StringField (readonly)

The vehicle owner's full name including maiden name.



20
21
22
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 20

def c1
  @c1
end

#c3Mindee::Parsing::Standard::StringField (readonly)

The vehicle owner's address.



23
24
25
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 23

def c3
  @c3
end

#c41Mindee::Parsing::Standard::StringField (readonly)

Number of owners of the license certificate.



26
27
28
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 26

def c41
  @c41
end

#c4aMindee::Parsing::Standard::StringField (readonly)

Mentions about the ownership of the vehicle.



29
30
31
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 29

def c4a
  @c4a
end

#d1Mindee::Parsing::Standard::StringField (readonly)

The vehicle's brand.



32
33
34
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 32

def d1
  @d1
end

#d3Mindee::Parsing::Standard::StringField (readonly)

The vehicle's commercial name.



35
36
37
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 35

def d3
  @d3
end

#eMindee::Parsing::Standard::StringField (readonly)

The Vehicle Identification Number (VIN).



38
39
40
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 38

def e
  @e
end

#f1Mindee::Parsing::Standard::StringField (readonly)

The vehicle's maximum admissible weight.



41
42
43
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 41

def f1
  @f1
end

#f2Mindee::Parsing::Standard::StringField (readonly)

The vehicle's maximum admissible weight within the license's state.



44
45
46
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 44

def f2
  @f2
end

#f3Mindee::Parsing::Standard::StringField (readonly)

The vehicle's maximum authorized weight with coupling.



47
48
49
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 47

def f3
  @f3
end

#formula_numberMindee::Parsing::Standard::StringField (readonly)

The document's formula number.



50
51
52
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 50

def formula_number
  @formula_number
end

#gMindee::Parsing::Standard::StringField (readonly)

The vehicle's weight with coupling if tractor different than category M1.



53
54
55
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 53

def g
  @g
end

#g1Mindee::Parsing::Standard::StringField (readonly)

The vehicle's national empty weight.



56
57
58
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 56

def g1
  @g1
end

#iMindee::Parsing::Standard::DateField (readonly)

The car registration date of the given certificate.



59
60
61
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 59

def i
  @i
end

#jMindee::Parsing::Standard::StringField (readonly)

The vehicle's category.



62
63
64
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 62

def j
  @j
end

#j1Mindee::Parsing::Standard::StringField (readonly)

The vehicle's national type.



65
66
67
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 65

def j1
  @j1
end

#j2Mindee::Parsing::Standard::StringField (readonly)

The vehicle's body type (CE).



68
69
70
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 68

def j2
  @j2
end

#j3Mindee::Parsing::Standard::StringField (readonly)

The vehicle's body type (National designation).



71
72
73
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 71

def j3
  @j3
end

#mrz1Mindee::Parsing::Standard::StringField (readonly)

Machine Readable Zone, first line.



74
75
76
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 74

def mrz1
  @mrz1
end

#mrz2Mindee::Parsing::Standard::StringField (readonly)

Machine Readable Zone, second line.



77
78
79
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 77

def mrz2
  @mrz2
end

#owner_first_nameMindee::Parsing::Standard::StringField (readonly)

The vehicle's owner first name.



80
81
82
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 80

def owner_first_name
  @owner_first_name
end

#owner_surnameMindee::Parsing::Standard::StringField (readonly)

The vehicle's owner surname.



83
84
85
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 83

def owner_surname
  @owner_surname
end

#p1Mindee::Parsing::Standard::StringField (readonly)

The vehicle engine's displacement (cm3).



86
87
88
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 86

def p1
  @p1
end

#p2Mindee::Parsing::Standard::StringField (readonly)

The vehicle's maximum net power (kW).



89
90
91
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 89

def p2
  @p2
end

#p3Mindee::Parsing::Standard::StringField (readonly)

The vehicle's fuel type or energy source.



92
93
94
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 92

def p3
  @p3
end

#p6Mindee::Parsing::Standard::StringField (readonly)

The vehicle's administrative power (fiscal horsepower).



95
96
97
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 95

def p6
  @p6
end

#qMindee::Parsing::Standard::StringField (readonly)

The vehicle's power to weight ratio.



98
99
100
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 98

def q
  @q
end

#s1Mindee::Parsing::Standard::StringField (readonly)

The vehicle's number of seats.



101
102
103
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 101

def s1
  @s1
end

#s2Mindee::Parsing::Standard::StringField (readonly)

The vehicle's number of standing rooms (person).



104
105
106
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 104

def s2
  @s2
end

#u1Mindee::Parsing::Standard::StringField (readonly)

The vehicle's sound level (dB).



107
108
109
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 107

def u1
  @u1
end

#u2Mindee::Parsing::Standard::StringField (readonly)

The vehicle engine's rotation speed (RPM).



110
111
112
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 110

def u2
  @u2
end

#v7Mindee::Parsing::Standard::StringField (readonly)

The vehicle's CO2 emission (g/km).



113
114
115
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 113

def v7
  @v7
end

#x1Mindee::Parsing::Standard::StringField (readonly)

Next technical control date.



116
117
118
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 116

def x1
  @x1
end

#y1Mindee::Parsing::Standard::StringField (readonly)

Amount of the regional proportional tax of the registration (in euros).



119
120
121
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 119

def y1
  @y1
end

#y2Mindee::Parsing::Standard::StringField (readonly)

Amount of the additional parafiscal tax of the registration (in euros).



122
123
124
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 122

def y2
  @y2
end

#y3Mindee::Parsing::Standard::StringField (readonly)

Amount of the additional CO2 tax of the registration (in euros).



125
126
127
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 125

def y3
  @y3
end

#y4Mindee::Parsing::Standard::StringField (readonly)

Amount of the fee for managing the registration (in euros).



128
129
130
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 128

def y4
  @y4
end

#y5Mindee::Parsing::Standard::StringField (readonly)

Amount of the fee for delivery of the registration certificate in euros.



131
132
133
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 131

def y5
  @y5
end

#y6Mindee::Parsing::Standard::StringField (readonly)

Total amount of registration fee to be paid in euros.



134
135
136
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 134

def y6
  @y6
end

Instance Method Details

#to_sString

Returns:

  • (String)


184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb', line 184

def to_s
  out_str = String.new
  out_str << "\n:a: #{@a}".rstrip
  out_str << "\n:b: #{@b}".rstrip
  out_str << "\n:c1: #{@c1}".rstrip
  out_str << "\n:c3: #{@c3}".rstrip
  out_str << "\n:c41: #{@c41}".rstrip
  out_str << "\n:c4a: #{@c4a}".rstrip
  out_str << "\n:d1: #{@d1}".rstrip
  out_str << "\n:d3: #{@d3}".rstrip
  out_str << "\n:e: #{@e}".rstrip
  out_str << "\n:f1: #{@f1}".rstrip
  out_str << "\n:f2: #{@f2}".rstrip
  out_str << "\n:f3: #{@f3}".rstrip
  out_str << "\n:g: #{@g}".rstrip
  out_str << "\n:g1: #{@g1}".rstrip
  out_str << "\n:i: #{@i}".rstrip
  out_str << "\n:j: #{@j}".rstrip
  out_str << "\n:j1: #{@j1}".rstrip
  out_str << "\n:j2: #{@j2}".rstrip
  out_str << "\n:j3: #{@j3}".rstrip
  out_str << "\n:p1: #{@p1}".rstrip
  out_str << "\n:p2: #{@p2}".rstrip
  out_str << "\n:p3: #{@p3}".rstrip
  out_str << "\n:p6: #{@p6}".rstrip
  out_str << "\n:q: #{@q}".rstrip
  out_str << "\n:s1: #{@s1}".rstrip
  out_str << "\n:s2: #{@s2}".rstrip
  out_str << "\n:u1: #{@u1}".rstrip
  out_str << "\n:u2: #{@u2}".rstrip
  out_str << "\n:v7: #{@v7}".rstrip
  out_str << "\n:x1: #{@x1}".rstrip
  out_str << "\n:y1: #{@y1}".rstrip
  out_str << "\n:y2: #{@y2}".rstrip
  out_str << "\n:y3: #{@y3}".rstrip
  out_str << "\n:y4: #{@y4}".rstrip
  out_str << "\n:y5: #{@y5}".rstrip
  out_str << "\n:y6: #{@y6}".rstrip
  out_str << "\n:Formula Number: #{@formula_number}".rstrip
  out_str << "\n:Owner's First Name: #{@owner_first_name}".rstrip
  out_str << "\n:Owner's Surname: #{@owner_surname}".rstrip
  out_str << "\n:MRZ Line 1: #{@mrz1}".rstrip
  out_str << "\n:MRZ Line 2: #{@mrz2}".rstrip
  out_str[1..].to_s
end