Class: CarRegistrationUAE
- Inherits:
-
Object
- Object
- CarRegistrationUAE
- Defined in:
- lib/CarRegistrationUAE.rb
Class Method Summary collapse
Class Method Details
.Lookup(registrationNumber, username, password) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/CarRegistrationUAE.rb', line 11 def self.Lookup(registrationNumber,username,password) begin @data = open("https://www.regcheck.org.uk/api/json.aspx/CheckUAE/" + registrationNumber,http_basic_authentication: [username, password]).read rescue OpenURI::HTTPError => error raise CarRegistrationLookupError, error.io.string end return JSON.parse(@data) end |