maverick_vin_parser 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 443f7a55d7a80e3d8164effa6c036d36623f123e
4
- data.tar.gz: 9d8f5626d941e38eaca7af6b874fb7dc16770940
3
+ metadata.gz: c1032dfabb432ca697d789a1f19c5b168b48e0f1
4
+ data.tar.gz: eb54acb11225be0f3c6c2754f53e8d50c9fdd252
5
5
  SHA512:
6
- metadata.gz: f78cdd953ef2359e441499009f93af7349d38480c382767c8ab6957e136dde4d05cd23ab06e5c9fa72d353ab6f014a62236423fb9c5375ab715eb5663ad656ff
7
- data.tar.gz: 09850e814d75b661b3405e5acd050c1a3d667ee0c052e482d425e8acf6137995ff58a207829ee3e5ed2c6f99a2efc8fb10b8af6ec436ae66248e451a8fe41fe2
6
+ metadata.gz: cb919cf5863bbd30e50109e939d7f0cbd0527b629dbee3a18619326fa28fbb1a14a59cfb53e55495781f2a43d28f8f4833e31748a81aa5600466e0501a7e010d
7
+ data.tar.gz: e8b68020d49512eb97cb6b8417f1efb5a552c3887d730eae0cf0f3135591c91461c56b9949c8124223b8bf1791649331f5440ba4bdca3b7e7feedfab8c4e229f
@@ -27,13 +27,16 @@ class MaverickVinParser
27
27
  #
28
28
  def parse(vin)
29
29
  @regex_main.match(vin) do
30
- return {
30
+
31
+ vehicle_hash = {
31
32
  year: 1970+$1.to_i,
32
33
  plant: PLANT_CODES[$2.to_sym],
33
34
  body: BODY_CODES[$3],
34
35
  engine: ENGINE_CODES[$4.to_sym],
35
- unit_number: $5.to_i - 100000
36
36
  }
37
+ unit_number_origin = vehicle_hash[:body].include?('Maverick') ? UNIT_NUMBER_ORIGIN_FORD : UNIT_NUMBER_ORIGIN_MERCURY
38
+ vehicle_hash[:unit_number] = $5.to_i - unit_number_origin
39
+ return vehicle_hash
37
40
  end
38
41
 
39
42
 
data/lib/vin_constants.rb CHANGED
@@ -33,4 +33,7 @@ module VinConstants
33
33
  F: '302ci 8-Cylinder 2 bbl'
34
34
  }
35
35
 
36
+ UNIT_NUMBER_ORIGIN_FORD = 100000
37
+ UNIT_NUMBER_ORIGIN_MERCURY = 500000
38
+
36
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maverick_vin_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Byron Appelt
@@ -22,7 +22,8 @@ files:
22
22
  - lib/vin_constants.rb
23
23
  - bin/maverick_vin_parser
24
24
  homepage: http://rubygems.org/gems/maverick_vin_parser
25
- licenses: []
25
+ licenses:
26
+ - MIT
26
27
  metadata: {}
27
28
  post_install_message:
28
29
  rdoc_options: []