Skip to content

Instantly share code, notes, and snippets.

@pullmonkey
Created October 28, 2011 15:49
Show Gist options
  • Save pullmonkey/1322591 to your computer and use it in GitHub Desktop.
Save pullmonkey/1322591 to your computer and use it in GitHub Desktop.
VIN API - ignore checksum validation
# first without ignoring the checksum, you'll see that we get an error
>> VinApi.find("VIN WITH BAD CHECKSUM GOES HERE")
=> #<VinApi @prefix_options={}, @attributes={"error"=>"Vin did not pass checksum test"}>
# next ignoring the checksum, we get our data
>> VinApi.find("VIN WITH BAD CHECKSUM GOES HERE", :params => {:ignore_checksum => "true"})
=> #<VinApi @prefix_options={}, @attributes={"body_style"=>"Coupe", "model"=>"ACCORD EX", "country"=>"USA", "world_region"=>"North America", "engine_type"=>"FWD", "vin"=>"VIN WITH BAD CHECKSUM GOES HERE", "transmission"=>"Automatic", "make"=>"Honda", "year"=>"2003"}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment