Sha256: e8eccdf3220b1fd2516d1d3da28ffe0698d5dd30c876b7233de3c816cfee5ca5
Contents?: true
Size: 788 Bytes
Versions: 11
Compression:
Stored size: 788 Bytes
Contents
module Vindetta class Vin class Wmi DATA_PATH = File.expand_path("../../data/wmi.yaml", __FILE__) def initialize(vin) @vin = vin end def name @name ||= self.class.data["wmi"][value] end alias eql? == def value @vin[0..2].join("") end def region @name ||= begin regions = self.class.data["region"] # TODO: Pull this out into private method regions.detect do |key, characters_for_region| break key if characters_for_region.include?(value[0]) end end end def ==(other) self.class == other.class && value == other.value end def self.data @data ||= YAML.load_file(DATA_PATH) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems