Giter Club home page Giter Club logo

hypertrack-ruby's Introduction

Gem Version Build Status

HyperTrack RubyGem

A RubyGem for HyperTrack's Backend API

Installation

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

Initialization:

require 'hypertrack'
HyperTrack.secret_key = "<YOUR_SECRET_KEY>"

HyperTrack - API and Resources

  • Driver

  • Customer

    • Create

      HyperTrack::Customer.create(name: "SomeCustomer")
    • Retrieve

      HyperTrack::Customer.retrieve(customer_id)
    • List

      HyperTrack::Customer.list
  • Destination

    • Create

      HyperTrack::Destination.create(customer_id: "customer_id")
    • Retrieve

      HyperTrack::Destination.retrieve(destination_id)
    • List

      HyperTrack::Destination.list
  • Task

    • Create

      HyperTrack::Task.create
    • Retrieve

      HyperTrack::Task.retrieve(task_id)
    • List

      HyperTrack::Task.list
    • Editable URLs

      HyperTrack::Task.retrieve(task_id).editable_url({ editable: value })
    • Start

      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") })
    • Complete

      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") })
    • Cancel

      HyperTrack::Task.retrieve(task_id).cancel
    • Update Destination Location

      HyperTrack::Task.retrieve(task_id).update_destination({ location: { type: "Point", coordinates: [ 71.5, 19.0 ] } })
  • Trip

    • Start

      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 })
    • Retrieve

      HyperTrack::Trip.retrieve(trip_id)
    • List

      HyperTrack::Trip.list
    • End Trip

      HyperTrack::Trip.retrieve(trip_id).end_trip({ end_location: { type: "Point", coordinates: [ 71.5, 19.0 ] } })
    • Send ETAs

      HyperTrack::Trip.sending_eta({ driver: driver_hash, destination: destination_hash })
    • Add Task

      HyperTrack::Trip.retrieve(trip_id).add_task({ task_id: task_id })
    • Remove Task

      HyperTrack::Trip.retrieve(trip_id).remove_task({ task_id: task_id })
    • Change task order

      HyperTrack::Trip.retrieve(trip_id).change_task_order({ task_order: [task1_id, task2_id] })
  • Neighbourhood

    • Retrieve

      HyperTrack::Neighbourhood.retrieve(neighbourhood_id)
    • List all

      HyperTrack::Neighbourhood.list
  • Fleet

    • Create

      HyperTrack::Fleet.create(name: "some_fleet")
    • Retrieve

      HyperTrack::Fleet.retrieve(fleet_id)
    • List all

      HyperTrack::Fleet.list
  • Hub

    • Create

      HyperTrack::Hub.create(name: "some_hub")
    • Retrieve

      HyperTrack::Hub.retrieve(hub_id)
    • List all

      HyperTrack::Hub.list
  • Shift

    • Start

      HyperTrack::Shift.create({ driver_id: "some_driver_id", start_location: { type: "Point", coordinates: [ 72.0, 19.0 ] } })
    • Retrieve

      HyperTrack::Shift.retrieve(shift_id)
    • List all

      HyperTrack::Shift.list
    • End Shift

      HyperTrack::Shift.retrieve(shift_id).end_shift(end_location: { type: "Point", coordinates: [ 72.0, 19.2 ] } })
  • Event

  • GPS Log

    • Retrieve

      HyperTrack::GPSLog.retrieve(event_id)
    • List all

      HyperTrack::GPSLog.list
    • Filtered List

      HyperTrack::GPSLog.filtered_list(driver_id:  "some_driver_id")

hypertrack-ruby's People

Contributors

utsavkesharwani avatar arjunattam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.