lib/vindetta/validator.rb in vindetta-0.17.1 vs lib/vindetta/validator.rb in vindetta-0.19.0
- old
+ new
@@ -1,15 +1,25 @@
module Vindetta
class Validator
def self.vin(vin)
- length(vin) && check_digit(vin)
+ return false unless vin.length == Vindetta::VIN_LENGTH
+
+ Calculator.check_digit(vin) == Decoder.check_digit(vin)
end
- def self.length(vin)
- vin.length == 17
+ def self.wmi(wmi)
+ return false unless wmi.length == Vindetta::WMI_LENGTH
end
- def self.check_digit(vin)
- Calculator.check_digit(vin) == Decoder.check_digit(vin)
+ def self.vds(vds)
+ return false unless vds.length == Vindetta::VDS_LENGTH
+
+ true
+ end
+
+ def self.vis(vis)
+ return false unless vis.length == Vindetta::VIS_LENGTH
+
+ true
end
end
end