Class: SynsbasenApi::WatchedVehicle
- Defined in:
- lib/synsbasen_api/resources/watched_vehicle.rb
Overview
The WatchedVehicle
class provides methods for interacting with watched vehicle related
endpoints in the Synsbasen API.
Constant Summary
Constants inherited from Client
Class Method Summary collapse
-
.all ⇒ ApiResponse
Retrieves all watched vehicles.
-
.subscribe(vehicle_id) ⇒ ApiResponse
Creates a new watched vehicle.
-
.unsubscribe(vehicle_id) ⇒ ApiResponse
Deletes a watched vehicle.
Methods inherited from Client
Class Method Details
.all ⇒ ApiResponse
Retrieves all watched vehicles.
12 13 14 |
# File 'lib/synsbasen_api/resources/watched_vehicle.rb', line 12 def all get("/v1/#{resource_name}") end |
.subscribe(vehicle_id) ⇒ ApiResponse
Creates a new watched vehicle.
21 22 23 |
# File 'lib/synsbasen_api/resources/watched_vehicle.rb', line 21 def subscribe(vehicle_id) post("/v1/#{resource_name}", body: { vehicle_id: vehicle_id }) end |
.unsubscribe(vehicle_id) ⇒ ApiResponse
Deletes a watched vehicle.
30 31 32 |
# File 'lib/synsbasen_api/resources/watched_vehicle.rb', line 30 def unsubscribe(vehicle_id) delete("/v1/#{resource_name}/#{vehicle_id}") end |