A RubyGem for HyperTrack's Backend API
Add this line to your application's Gemfile:
gem 'hypertrack'
And then run bundle install
on command line.
Or install it yourself as: gem install hypertrack
require 'hypertrack'
HyperTrack.secret_key = "<YOUR_SECRET_KEY>"
-
-
HyperTrack::Driver.create(name: "SomeDriver", vehicle_type: "car")
-
HyperTrack::Driver.retrieve(driver_id)
-
HyperTrack::Driver.list
-
HyperTrack::Driver.retrieve(driver_id).overview
-
HyperTrack::Driver.map_list
-
-
-
HyperTrack::Task.create
-
HyperTrack::Task.retrieve(task_id)
-
HyperTrack::Task.list
-
HyperTrack::Task.retrieve(task_id).editable_url({ editable: value })
-
task = HyperTrack::Task.retrieve(task_id) task.start({ start_location: { type: "Point", coordinates: [ 72.0, 19.0 ] }, vehicle_type: "car", driver_id: driver_id, start_time: Time.now.strftime("%Y-%m-%dT%H:%M") })
-
task = HyperTrack::Task.retrieve(task_id) task.complete({ completion_location: { type: "Point", coordinates: [ 72.0, 19.3 ] }, completion_time: Time.now.strftime("%Y-%m-%dT%H:%M") })
-
HyperTrack::Task.retrieve(task_id).cancel
-
HyperTrack::Task.retrieve(task_id).update_destination({ location: { type: "Point", coordinates: [ 71.5, 19.0 ] } })
-
-
-
HyperTrack::Trip.create({ driver_id: driver_id, start_location: { type: "Point", coordinates: [ 72.0, 19.0 ] }, tasks: [task1_id, task2_id], vehicle_type: "car", has_ordered_tasks: true })
-
HyperTrack::Trip.retrieve(trip_id)
-
HyperTrack::Trip.list
-
HyperTrack::Trip.retrieve(trip_id).end_trip({ end_location: { type: "Point", coordinates: [ 71.5, 19.0 ] } })
-
HyperTrack::Trip.sending_eta({ driver: driver_hash, destination: destination_hash })
-
HyperTrack::Trip.retrieve(trip_id).add_task({ task_id: task_id })
-
HyperTrack::Trip.retrieve(trip_id).remove_task({ task_id: task_id })
-
HyperTrack::Trip.retrieve(trip_id).change_task_order({ task_order: [task1_id, task2_id] })
-
-
-
HyperTrack::Shift.create({ driver_id: "some_driver_id", start_location: { type: "Point", coordinates: [ 72.0, 19.0 ] } })
-
HyperTrack::Shift.retrieve(shift_id)
-
HyperTrack::Shift.list
-
HyperTrack::Shift.retrieve(shift_id).end_shift(end_location: { type: "Point", coordinates: [ 72.0, 19.2 ] } })
-
-
-
HyperTrack::GPSLog.retrieve(event_id)
-
HyperTrack::GPSLog.list
-
HyperTrack::GPSLog.filtered_list(driver_id: "some_driver_id")
-