Class: Vindetta::Vin::Wmi
- Inherits:
-
Object
- Object
- Vindetta::Vin::Wmi
- Defined in:
- lib/vindetta/vin/wmi.rb
Constant Summary collapse
- DATA_PATH =
File.("../../data/wmi.yaml", __FILE__)
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql? ⇒ Object
-
#initialize(vin) ⇒ Wmi
constructor
A new instance of Wmi.
- #name ⇒ Object
- #value ⇒ Object
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
.data ⇒ Object
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? == |
#name ⇒ Object
10 11 12 |
# File 'lib/vindetta/vin/wmi.rb', line 10 def name @name ||= self.class.data[value] end |
#value ⇒ Object
16 17 18 |
# File 'lib/vindetta/vin/wmi.rb', line 16 def value @vin[0..2].join("") end |