class DoubleMap::Client::Vehicles
Public Instance Methods
get(id)
click to toggle source
Return the vehicle whose id matches the given id
# File lib/doublemap_api/client/vehicles.rb, line 13 def get id list.find{ |vehicle| vehicle.id == id } end
Also aliased as: find
list()
click to toggle source
Return a list of all vehicles currently traveling on routes.
# File lib/doublemap_api/client/vehicles.rb, line 6 def list get_request('/map/v2/buses').map{ |vehicle| Vehicle.new(vehicle) }.each(&on_vehicle) end
Also aliased as: all
Private Instance Methods
on_vehicle()
click to toggle source
# File lib/doublemap_api/client/vehicles.rb, line 21 def on_vehicle DoubleMap.configuration.on_vehicle end