Sha256: 3b6c274b94c8f4c59dbc721e2c9035fbc80f7fa56d2b646c5bdbe64191c67e66
Contents?: true
Size: 711 Bytes
Versions: 1
Compression:
Stored size: 711 Bytes
Contents
require "vindetta/decoder/result" require "net/http" require "json" module Vindetta class Decoder def self.vin(vin) Result.new(Api.get(vin)["Results"]) end def self.plant_code(vin) vin[10] end def self.check_digit(vin) vin[8] end def self.wmi(vin) vin[0..2] end def self.vds(vin, options = {}) defaults = { :check_digit => true } options = defaults.merge(options) vin[3..8].tap do |vds| vds.chop! unless options[:check_digit] end end def self.year(vin) vin(vin).year end def self.vis(vin) vin[9..16] end def self.production_number(vin) vin[11..16] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vindetta-0.17.0 | lib/vindetta/decoder.rb |