Class: Vindetta::Vin::Wmi

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

Constant Summary collapse

DATA_PATH =
File.expand_path("../../data/wmi.yaml", __FILE__)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vin) ⇒ Wmi

Returns a new instance of Wmi.



6
7
8
# File 'lib/vindetta/vin/wmi.rb', line 6

def initialize(vin)
  @vin = vin
end

Class Method Details

.dataObject



24
25
26
# File 'lib/vindetta/vin/wmi.rb', line 24

def self.data
  @data ||= YAML.load_file(DATA_PATH)
end

Instance Method Details

#==(other) ⇒ Object



20
21
22
# File 'lib/vindetta/vin/wmi.rb', line 20

def ==(other)
  self.class == other.class && value == other.value
end

#eql?Object



14
# File 'lib/vindetta/vin/wmi.rb', line 14

alias eql? ==

#nameObject



10
11
12
# File 'lib/vindetta/vin/wmi.rb', line 10

def name
  @name ||= self.class.data[value]
end

#valueObject



16
17
18
# File 'lib/vindetta/vin/wmi.rb', line 16

def value
  @vin[0..2].join("")
end