# File lib/faker/vehicle.rb, line 9 def vin _, wmi, wmi_ext = fetch_all('vehicle.manufacture').sample c = VIN_CHARS.split('').reject{ |n| n == '.'} vehicle_identification_number = wmi.split('').concat( Array.new(14) { c.sample } ) (12..14).to_a.each_with_index { |n, i| vehicle_identification_number[n] = wmi_ext[i] } unless wmi_ext.nil? vehicle_identification_number[10] = fetch('vehicle.year') vehicle_identification_number[8] = vin_checksum(vehicle_identification_number) vehicle_identification_number.join.upcase end