Module: MotoRecall

Defined in:
lib/moto_recall.rb,
lib/moto_recall/recall.rb,
lib/moto_recall/version.rb,
lib/moto_recall/class_map.rb,
lib/moto_recall/recall_set.rb

Defined Under Namespace

Modules: ClassMap, Client, Sampler Classes: ClientException, InvalidVinError, Recall, RecallSet, UnsupportedMakeError

Constant Summary collapse

VERSION =
"0.0.21"

Class Method Summary collapse

Class Method Details

.find(make, vin) ⇒ Object

Raises:



29
30
31
32
33
34
35
36
37
# File 'lib/moto_recall.rb', line 29

def self.find(make, vin)
  raise InvalidVinError, "VIN is not 17 chars" if vin.length != 17
  client_class = ClassMap.class_for_make(make)
  begin
    client_class.new.find(vin)
  rescue StandardError => error
    raise MotoRecall::ClientException, "(#{client_class}) #{error.class}: #{error.inspect}\n#{error.backtrace.join("\n")}"
  end
end