Class: Vindetta::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/vindetta/validator.rb

Class Method Summary collapse

Class Method Details

.vds(vds) ⇒ Object



15
16
17
18
19
# File 'lib/vindetta/validator.rb', line 15

def self.vds(vds)
  return false unless vds.length == Vindetta::VDS_LENGTH

  true
end

.vin(vin) ⇒ Object



3
4
5
6
7
# File 'lib/vindetta/validator.rb', line 3

def self.vin(vin)
  return false unless vin.length == Vindetta::VIN_LENGTH

  Calculator.check_digit(vin) == Decoder.vin(vin)[:check_digit]
end

.vis(vis) ⇒ Object



21
22
23
24
25
# File 'lib/vindetta/validator.rb', line 21

def self.vis(vis)
  return false unless vis.length == Vindetta::VIS_LENGTH

  true
end

.wmi(wmi) ⇒ Object



9
10
11
12
13
# File 'lib/vindetta/validator.rb', line 9

def self.wmi(wmi)
  return false unless wmi.length == Vindetta::WMI_LENGTH

  true
end