class CarRegistrationSweden

Public Class Methods

Lookup(registrationNumber,username,password) click to toggle source
# File lib/CarRegistrationSweden.rb, line 11
def self.Lookup(registrationNumber,username,password)
       begin
               @data = open("https://www.regcheck.org.uk/api/json.aspx/CheckSweden/" + registrationNumber,http_basic_authentication: [username, password]).read      
       rescue OpenURI::HTTPError => error
                raise CarRegistrationLookupError, error.io.string
       end
       return JSON.parse(@data)
end