Sha256: e261331833bc401c62188fd76b4b3f7f1792f1c01ed357badeedacad604dc0f9

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 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[value]
      end

      alias eql? ==

      def value
        @vin[0..2].join("")
      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

1 entries across 1 versions & 1 rubygems

Version Path
vindetta-0.8.0 lib/vindetta/vin/wmi.rb