Class: Nummerplade::ApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/nummerplade.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_token) ⇒ ApiClient

Returns a new instance of ApiClient.



9
10
11
12
# File 'lib/nummerplade.rb', line 9

def initialize api_token
  @api_token = api_token
  @url = 'http://api.nrpla.de/'
end

Instance Attribute Details

#api_tokenObject

Returns the value of attribute api_token.



7
8
9
# File 'lib/nummerplade.rb', line 7

def api_token
  @api_token
end

Instance Method Details

#debt(vehicle_id) ⇒ Object



26
27
28
# File 'lib/nummerplade.rb', line 26

def debt vehicle_id
  request("debt/" + vehicle_id)
end

#dmr(vehicle_id) ⇒ Object



22
23
24
# File 'lib/nummerplade.rb', line 22

def dmr vehicle_id
  request("dmr/" + vehicle_id)
end

#inspections(vehicle_id) ⇒ Object



30
31
32
# File 'lib/nummerplade.rb', line 30

def inspections vehicle_id
  request("inspections/" + vehicle_id)
end

#vehicle_by_registration(registration) ⇒ Object



14
15
16
# File 'lib/nummerplade.rb', line 14

def vehicle_by_registration registration
  request(registration)
end

#vehicle_by_vin(vin) ⇒ Object



18
19
20
# File 'lib/nummerplade.rb', line 18

def vehicle_by_vin vin
  request("vin/" + vin)
end