Sha256: bee3d0fa29ec538c8580158e8e1bd5d2ef5d7d13e46ae55e46a771f6edca7969

Contents?: true

Size: 305 Bytes

Versions: 7

Compression:

Stored size: 305 Bytes

Contents

require "httparty"
require "vindetta/decoder/result"

module Vindetta
  class Decoder
    def self.decode_vin(vin)
      result = HTTParty.get("https://vpic.nhtsa.dot.gov/api/vehicles/decodevin/#{vin}?format=json")
      json = JSON.parse(result.body)

      Result.new(json["Results"])
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vindetta-0.15.0 lib/vindetta/decoder.rb
vindetta-0.14.0 lib/vindetta/decoder.rb
vindetta-0.13.0 lib/vindetta/decoder.rb
vindetta-0.12.0 lib/vindetta/decoder.rb
vindetta-0.11.0 lib/vindetta/decoder.rb
vindetta-0.10.0 lib/vindetta/decoder.rb
vindetta-0.9.0 lib/vindetta/decoder.rb