Gatekeeper API Client

Common logic for consuming the GateKeeper API.

Installation

Add this line to your application's Gemfile:

source "https://rubygems.pkg.github.com/inforlife" do
  gem "gatekeeper_api_client", "1.0.0"
end 

Usage

The application using this gem must have defined the following environemnt variables:

  • GATEKEEPER_API_KEY
  • GATEKEEPER_TIMEZONE
  • GATEKEEPER_URL

Transit

To post a transit, build an object with a record and send the post message to it.

Transit.new(record).post

The record must respond to:

  • authorized
  • badge_number
  • date
  • sensor_code
  • time
  • valid?

Employee

To post an employee, build an object with a record and send the post message to it.

Employee.new(record).post

The record must respond to:

  • employee_name
  • badge_number
  • department_name
  • valid?