Class: VinValidator::Maker

Inherits:
BaseModel show all
Defined in:
lib/vin_validator/maker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

all

Constructor Details

#initialize(id:, name:) ⇒ Maker

:nodoc:



28
29
30
31
32
33
# File 'lib/vin_validator/maker.rb', line 28

def initialize(id:, name:)
  super

  @id = id
  @name = name
end

Instance Attribute Details

#idInteger

Returns:

  • (Integer)


23
24
25
# File 'lib/vin_validator/maker.rb', line 23

def id
  @id
end

#nameString

Returns:

  • (String)


25
26
27
# File 'lib/vin_validator/maker.rb', line 25

def name
  @name
end

Class Method Details

.find(id) ⇒ VinValidator::Maker

Finds the maker with the given ‘id`

Returns:



10
11
12
# File 'lib/vin_validator/maker.rb', line 10

def find(id)
  all.fetch(id.to_s)
end